Commands and Messages
Command
A command represents an action that a user may take, such as casting a vote in a poll or changing their public key if bribed. It is made up of the following parameters:
Symbol | Name | Size | Description |
---|---|---|---|
State index | 50 | State leaf index where the signing key is located | |
Public key x-coordinate | 253 | If no change is necessary this parameter should reflect the current public key's x-coordinate | |
Public key y-coordinate | 253 | If no change is necessary this parameter should reflect the current public key's y-coordinate | |
Vote option index | 50 | Option state leaf index of preference to assign the vote for | |
Voting weight | 50 | Voice credit balance allocation, this is an arbitrary value dependent on a user's available credits | |
Nonce | 50 | State leaf's index of actions committed plus one | |
Poll id | 50 | The poll's identifier to cast in regard to | |
Salt | 253 | An entropy value to inhibit brute force attacks |
Message
A message is an encrypted command using the shared key between the voter and the coordinator. The plaintext is computed as such:
While the message can be computed with the formula below:
=
Decrypting a message
To decrypt a message using we have the following:
=
To unpack to its original five parameters, it must be separated into 50 bit values from the parent 250 bit value. To extract 50 bits at byte , we:
- initialise 50 bits
- shift left by bits
- bitwise AND with
- shift right by bits