Ed25519

Ed25519 is the signature scheme being used in Cardano, and supported in Plutus. Ed25519 is an instantiation of the EdDSA over the Edwards25519 elliptic curve.

Generalised specification

This section presents the generalized signature system EdDSA, and in the parameter section, we present the specific parameters used in Cardano. EdDSA is parametrized with the following parameters. An integer , a cryptographic hash function producing a -bit output, and a finite abelian group based on an elliptic curve. An EdDSA, signature consists of the following three algorithms:

  • takes as input the security parameter and returns a key-pair . First, it chooses . Next, let , and compute the signing key, . Finally, compute , and return .
  • takes as input a keypair and a message , and returns a signature . Let , and interpret the result as a little-endian integer in . Let , and . Return .
  • takes as input a message , a verification key and a signature , and returns depending on whether the signature is valid or not. The algorithm returns if the following equation holds and otherwise:

Parameters of instantiation

In this section we set to describe the concrete instantiation of the algorithm presented above. Not only we describe the Curves and Hash functions used, but we also specify how deserialization happens, as this results in important differences of the acceptance criteria of valid signatures. The algorithm we use is Ed255191. However, our implementation slightly differs in the deserialization criteria. The details are as follows:

  • Parameter : We set
  • Curve: We define the curve, and by consequence the finite prime order field, security parameter, cofactor, prime order subgroup and generator. In particular, we use Edwards25519 which is birationally equivalent to Curve255192.
  • Hash: As a hashing algorithm we use SHA512.
  • Deserialization: A signature is represented by 64 bytes: the first 32 bytes, , represent the point , and the final 32 bytes, , represent the scalar . A public key is also represented as 32 bytes, . Deserialization is valid only if:
    • , read as a little-endian integer, is smaller than .
    • does not represent a low order point (by checking against a precomputed blacklist of size ).
    • does not represent a low order point (by checking against a precomputed blacklist of size ), and when read as a little-endian integer, it is smaller than .
1

Bernstein, Duif, Lange, Schwabe and Yang, High-Speed High-Security Signatures

2

Bernstein, Curve25519: New Diffie-Hellman Speed Records