Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Oct 28, 2024
1 parent d3c6d3c commit b67bab7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
vote_tx = [
vote_tx_body,
vote-tx = [
vote-tx-body,
signature
]

vote_tx_body = [
vote_type
vote-tx-body = [
vote-type
event,
votes,
voters_data,
voters-data,
]

vote_type = UUID ; e.g. Public or Private vote
event = { * event_key => any }
event_key = int / text
vote-type = UUID ; e.g. Public or Private vote
event = { * event-key => any }
event-key = int / text

votes = [+ vote]
vote = [
choices,
proof \ null,
prop_id \ null,
prop-id \ null,
]
choices = [+ choice]
choice = encoded-cbor
proof = encoded-cbor
prop_id = encoded-cbor
prop-id = encoded-cbor

voters_data = encoded-cbor
voters-data = encoded-cbor

UUID = #6.37(bytes) ; UUID type
signature = #6.98(COSE_Sign) ; COSE signature
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cose_payload = blake2b-256
cose-payload = blake2b-256
blake2b-256 = #6.32782(bytes .size 32) ; Blake2b-256 hash bytes
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
vote_tx_v2 = vote_tx
vote-tx-v2 = gen-vote-tx

choice = #6.24(bstr(choice_data))
proof = #6.24(bstr(proof_data))
prop_id = #6.24(bstr(proposal))
choice = #6.24(bstr(choice-data))
proof = #6.24(bstr(proof-data))
prop-id = #6.24(bstr(proposal))

choice_data = public_choice / private_choice
choice-data = public-choice / private-choice

public_choice = uint
private_choice = ciphertext
public-choice = uint
private-choice = ciphertext

ciphertext = [group_element, group_element]
group_element = bytes .size 32
ciphertext = [group-element, group-element]
group-element = bytes .size 32

proposal = UUID

proof_data = zk_proof
proof-data = zk-proof

zk_proof = [[+ (announcement, ciphertext, r-response)], scalar]
zk-proof = [[+ (announcement, ciphertext, r-response)], scalar]

announcement = (group_element, group_element, group_element)
ciphertext = (group_element, group_element)
announcement = (group-element, group-element, group-element)
ciphertext = (group-element, group-element)
r-response = (scalar, scalar, scalar)

scalar = bytes .size 32
group_element = bytes .size 32
group-element = bytes .size 32

;# include gen_vote_tx

Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ Vote:

* `choices` - a collection of voter choices for the proposal.
* `proof` - a voter proof, could be `null`.
* `prop_id` - a proposal id for which `choice` is made, could be `null`.
* `prop-id` - a proposal id for which `choice` is made, could be `null`.
For that case where for the `event` defined only **one** proposal,
so it's redundant to provide an additional identifier for the proposal,
so it could be placed `null`.

`voters_data` - an any additional voter's specific data.
`voters-data` - an any additional voter's specific data.

### Transaction signing

Expand Down

0 comments on commit b67bab7

Please sign in to comment.