EdDSA is a variant of the Schnorr Signature. EdDSA is standardized by the IETF in RFC8032. The most recommended instantiation is ed25519, which implements EdDSA on the twisted edwards curve edwards25519.
Let the expression
A twisted edwards curve is a twist of an edwards curve. Curves of interest here are the family of twisted edwards curves
where
- where
$a, d \in \mathbb{Z_q}$ , with$a,d \ne 0$ and$a \ne d$ . The special case$a=1$ is untwisted, because the curve reduces to an ordinary Edwards curve. -
$a$ is a square in$\mathbb{Z_q}$ and$b$ is a non square in$\mathbb{Z_q}$ ,
Let the expression
-
$\circ$ is a point addition operation such that, for$P=(x_1, y_1), Q=(x_2, y_2) \in \mathbb{E_{(\mathbb{Z_q})}}$ , the sum$P \circ Q = (x_3, y_3) \in \mathbb{E}_{TEd}$ , -
$O$ is the identity element at the point$O = (0, 1)$ , - there is an additive inverse of
$P=(x_P, y_P)$ is$(-P) = (-x_P, y_P) \in \mathbb{E}_{TEd}$ . -
$G$ is the generator of the group, - p is the order of the generator
$G$ ,
Reviewing finite cyclic elliptic curve groups is essential for the understanding of ECDSA maths below.
Edwards25519 is birationally equivalent to Montgomery curve curve25519, which due to its efficient arithmetic implementation, allows for constructions of very performant cryptographic applications.
Edwards25519 is defined over the finite field
- curve order
$q = 2^{255} - 19$ , is the number of points on the curve, - curve equation:
$−x^2 + y^2 = 1 − (121665/121666) * x^2 * y^2$ . - generator point
$G = (x, 4/5) \text{ and } x>0$ , x can be computed from the curve. - generator order
$p = 2^{252} + 27742317777372353535851937790883648493$
Curve25519 is defined over the finite field
- curve order
$q = 2^{255} - 19$ and - curve equation:
$y^2 = x^3 + 486662x^2 + x$ .
The definition of bit and byte strings as used here is found in strings expressions.
EdDSA points are encoded in the format:
- Coordinates of point
$P=(x_P, y_P), x_P, y_P \in \mathbb{Z_q}$ are serialized to bytes in little endian byte order. - The scalar
$x_P$ is therefore represented as$x_{P<(le:o):32>}$ where-
$o$ stands for octet string -
$le$ stands for little endian bytes order -
$32$ is the size in octets of the string. - to present this in bytes, we can write
$x_{P<(le:o)(b):256>}$ meaning the binary representation of the octet string.
-
- The sign of a the scalar
$x_P$ could be represented as$x_{P<(sign)(le:o)(b):1>} = x_{P<(le:o)(b):256:[0]>}$ . This representation only tells the reader that the expression contains only the sign of$x_P$ . But also indicates that the byte conversion from the scalar$x_P$ occured in the little endian order. - The encoding of point
$P$ ends up looking like
This will add the sign bit of
Never write an expression like
RFC-8032 foresees the usage of a pre hash function for following variants:
- PureEdDSA uses the identity function as a prehash, resulting in
$phm_{<(b):?>} = PH(M_{<(b):?>})=M_{<(b):?>}$ - HashEdDSA used a collision resistant hash function like sha512, resulting in
$phm_{<(b):?>}=sha512(M_{<(b):?>})$
In the rest of the document, we will use
RFC-8032 allows the inclusion of context information in the computation of the hash. Both the prehash flag and the context info are specified with the function
- For Ed25519: this information is an empty string, means
$|dom2(phflag,context)|=0$ ensuring compatibility to previous versions. - For Ed25519ctx:
-
$phflag=0$ , means prehash function is the identity function (means PureEdDSA), -
$context$ is a non-empty octet string of length$1<= length <= 32$ . The value is agreed upon by signer and verifiers. - let
$flag_{<(b):32>} = ASCII(\text{SigEd25519 no Ed25519 collisions})$ -
$dom2_{<(b):?>}(x,y) = flag_{<(b):32>} || x_{<(o):1>} || l_{<(o):1>} ||y_{<(b):l>}$ , where- phflag
$x_{<(o):1>} \equiv 0_{<(o):1>}$ -
$l_{<(o):1>}$ is the length of$y \text{ with } 1<= l <= 32$ -
$y_{<(b):l>}$ is the bit string of the context information os size$l$
- phflag
-
- For Ed25519ph:
-
$phflag=1$ , with the pre hash function$sha512$ - let
$flag_{<(b):256>} = ASCII(\text{SigEd25519 no Ed25519 collisions})$ -
$dom2_{<(b):?>}(x,y) = flag_{<(b):256>} || x_{<(o):1>} || l_{<(o):1>} ||y_{<(b):l>}$ , where- phflag
$x=1$ -
$l$ is the length of$y \text{ with } 0 <= l <= 255$ -
$y_{<(b):l>}$ is the bit string of the context information
- phflag
-
Finally as notational convention
- let
$FLAG_{<(b):?>} \equiv dom2(phflag,context)$ in the rest of the document, - let
$phm_{<(b):?>}$ be the pre hashed message as defined above.
Following steps produce a key used with ed255519:
-
Generate a random secret seed
$k_{<(b):256>}$ for the user, -
compute
$z_{<(b):512>} = sha512(FLAG_{<(b):?>} || k_{<(b):256>})$ , -
compute the private key scalar
$$a_{<(le:o):32>} = 2^n \sum_{i=c}^{n-1} 2^iz_{<(b):512:[i]>}$$ clearing high and low order bits, where
-
$c = log_2(8) = 3$ ,$8$ being the cofactor of the curve, this construction clears the first 3 (low order) bits of the private key. -
$n = 254$ . Starting with$2^{254}$ , we set the lower bound of the secret scalar and clear the high order bit at$255$ . Therefore all secret scalars are$255$ bits.
-
-
compute the public key
$A = aG$ , -
return
$A_{<(ed:b):256>}||k_{<(b):256>}$
Following steps produce a ed255519 signature:
- let
$M_{<(b):?>}$ be the bit representation of the message, - compute
$z_{<(b):512>} = sha512(FLAG_{<(b):?>} || k_{<(b):256>})$ , - compute the private key scalar
$a_{<(le:o):32>} = 2^n \sum_{i=c}^{n-1} 2^iz_{<(b):512:[i]>}$ , - compute the deterministic secret scalar
- compute the secret point
$R=rG$ , - compute the message scalar
- For efficiency, compute
$u \equiv u_{<(le:o):64>} \pmod p$ , where$p$ is the order of$G$ , - compute the signature scalar
$s \equiv r + (u \times a) \pmod p$ , - return the encoded signature
$\sigma_{<(b):512>} = R_{<(ed:b):256>}||s_{<(le:o)(b):256>}$
The verifier has access to:
- the encoded signature
$\sigma_{<(b):512>} = R_{<(ed:b):256>}||s_{<(le:o)(b):256>}$ - the public key point
$A$
The verifier can:
- verify the public key point
$A \in \mathbb{E}_{(Z_q)}$ - compute the random point
$R \leftarrow R_{<(ed:b):256>}$ - verify
$R \in \mathbb{E}_{(Z_q)}$ - verify the signature scalar
$s \in \mathbb{Z_q}$
Further variant specific checks
- check that
$0 \lt s \lt p$ , where$p = |G|$ , the order of the generator G
A signature is verified by applying
EdDSA signature aggregation follows the same procedure as Schnorr signature aggregation.
EdDSA multi signature also follows the same procedure as Schnorr multi signature.
But as EdDSA is constructed over a nonlinear key space, the HD key derivation process is different.
Using Ed25519-BIP32 to produce deterministic
Recall children key indexes might derive invalide keys, therefore all parties must agree upon idex ranges that are tested by all parties.
Recall that for EdDSA we use the right side of the secret seed to produce a deterministic secret point
Threshold signature requires a
Assume a group of
As soon as we know the set of participants
This is explained in detail in retrieving the secret.
Remark that we are using the symbol
The TSS challenge consists in coordinating a distributed computation among members of subset
Per schnorr signature, the random point
Recall
where
It is good to remember that the secret key
Recall
Each
Upon receiving all
With
With
Upon receiving all
This signature will verify like any other EdDSA signature.
Using ED-BIP32 key derivation to enforce generation of
Using BIP32, we create the opportunity of generating public keys
Having proceeded with an
Knowing
We can generate a neutered children random numbers $z_{nL} and
-
$z_{nL<(o:le):28>} = z_{n<(o):64:[:27]>}$ , we take the first$28$ octets of$z_n$ , -
$z_{nR<(o:le):32>} = z_{n<(o):64:[32:]>}$ , we take the last$32$ octets of$z_n$ ,
Knowing that the derivation algorithm for a single key signature produces this,
$a_{child:i} = (8 \times z_{nL}) + a_{parent}$ $r_{child:i} = z_{nR} + r_{parent} \pmod {2^{256}}$
The public key
Out of the DKG procedure, we have
Instead of adding entire
The public image of the random key
The only constraint we have here is that single
In order to achieve this, we divide the derived
Recall that using HD key derivation and knowing:
- the preimage of the message to be signed
$phm_{<(b):?>} \leftarrow M$ , - the child index to use
$i$ ,
Each signing party
With
With
Upon receiving all
This looks like a powerful tool for key recovery procedures including the use of offline parties, as interaction is barely needed for the signature of messages.
Proceed with BLS on pairings.