code: def sign(payload, keypair):
      
      get_ed25519ll()
      #
      header = {
                  "alg": ALG,
                  "jwk": {
                      "kty": ALG,  # alg -> kty in jwk-08.
                      "vk": native(urlsafe_b64encode(keypair.vk))
                  }
               }
  
      encoded_header = urlsafe_b64encode(binary(json.dumps(header, sort_keys=True)))
      encoded_payload = urlsafe_b64encode(binary(json.dumps(payload, sort_keys=True)))
      secured_input = b".".join((encoded_header, encoded_payload))
      sig_msg = ed25519ll.crypto_sign(secured_input, keypair.sk)
      signature = sig_msg[:ed25519ll.SIGNATUREBYTES]
      encoded_signature = urlsafe_b64encode(signature)
  
      return {"recipients":
              [{"header": native(encoded_header),
                "signature": native(encoded_signature)}],
              "payload": native(encoded_payload)}
docs: Return a JWS-JS format signature given a JSON-serializable payload and
      an Ed25519 keypair.