code: def ed25519_private_key_to_string(key):
      
      return base64.b64encode(key.private_bytes(
          encoding=serialization.Encoding.Raw,
          format=serialization.PrivateFormat.Raw,
          encryption_algorithm=serialization.NoEncryption()
      ), None).decode('utf-8')
docs: Convert an ed25519 private key to a base64-encoded string.
  
      Args:
          key (Ed25519PrivateKey): the key to write to the file.
  
      Returns:
          str: the key representation as a str