StateLeaf
A state leaf represents a user's participation declared through an identity (their public key) and information relevant to their ability or right to cast votes in a poll (their voice credit balance and the block timestamp at which they signed up).
We define a state leaf as the hash of the following:
| Symbol | Name | Comments |
|---|---|---|
| Public key's x-coordinate | ||
| Public key's y-coordinate | ||
| Voice credit balance | ||
| Block timestamp | In Unix time (seconds since Jan 1 1970 UTC) |
The hash is computed as such:
Blank state leaf
A blank state leaf has the following value:
This value is computed as such:
The code to derive and is here. The function call required is pedersenHash.getBasePoint('blake', 0)
- Hash the string
PedersenGenerator_00000000000000000000000000000000_00000000000000000000000000000000with . In big-endian hexadecimal format, the hash should be1b3ef77ef2cd620fd2358e69dd564f35556aad552fdd7f06b777bd3a1d697160. - Set the 255th bit to 0. The result should be
1b3ef77ef2cd620fd2358e69dd564f35556aad552fdd7f06b777bd3a1d697120. - Use the method to convert a buffer to a point on the BabyJub curve described in [2.3.2].
- Multiply the point by 8. The result is the point with x-value and y-value
Given the elliptic curve discrete logarithm problem, we assume that no one knows the private key and by using the public key generation procedure in [1.4], we can derive and . Furthermore, the string above (PedersenGenerator...) acts as a nothing-up-my-sleeve value.