-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlp-0002-private-multisig.idl.json
More file actions
96 lines (96 loc) · 4.08 KB
/
Copy pathlp-0002-private-multisig.idl.json
File metadata and controls
96 lines (96 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
"name": "private_multisig",
"version": "0.2.0",
"metadata": {
"spec": "SPEL IDL",
"target": "Logos Execution Zone v0.2.0",
"notes": "Vote is the initial call of a privacy-preserving transaction; its args (incl. nsk) are private instruction data and never appear on-chain."
},
"instructions": [
{
"name": "initialize",
"accounts": [
{ "name": "multisig", "isMut": true, "isSigner": true, "docs": "Fresh account claimed by the program (signed once with its key, program-owned afterwards)." }
],
"args": [
{ "name": "threshold", "type": "u8" },
{ "name": "commitments", "type": { "vec": { "array": ["u8", 32] } }, "docs": "SHA256(\"member\" || nsk || multisig_id) per member." }
]
},
{
"name": "submit_proposal",
"accounts": [
{ "name": "multisig", "isMut": true, "isSigner": false }
],
"args": [
{ "name": "proposal_id", "type": { "array": ["u8", 32] } },
{ "name": "action", "type": "bytes", "docs": "Opaque action bytes: the parameter change this proposal gates." }
]
},
{
"name": "vote",
"privacy": "privacy-preserving transaction (initial call); all args are private witnesses",
"accounts": [
{ "name": "multisig", "isMut": true, "isSigner": false, "docs": "Public pre/post state (mask 0)." },
{ "name": "rider", "isMut": true, "isSigner": false, "docs": "The member's LIVE shielded voting account at AccountId::for_regular_private_account(npk(nsk), 0); asserted in-circuit." }
],
"args": [
{ "name": "nsk", "type": { "array": ["u8", 32] }, "docs": "PRIVATE: the member's shielded-account nullifier secret key." },
{ "name": "member_index", "type": "u32" },
{ "name": "proposal_id", "type": { "array": ["u8", 32] } }
]
},
{
"name": "execute",
"accounts": [
{ "name": "multisig", "isMut": true, "isSigner": false }
],
"args": [
{ "name": "proposal_id", "type": { "array": ["u8", 32] } }
]
}
],
"accounts": [
{
"name": "MultisigState",
"encoding": "borsh",
"type": {
"kind": "struct",
"fields": [
{ "name": "threshold", "type": "u8" },
{ "name": "member_commitments", "type": { "vec": { "array": ["u8", 32] } } },
{ "name": "proposals", "type": { "vec": { "defined": "Proposal" } } }
]
}
},
{
"name": "Proposal",
"encoding": "borsh",
"type": {
"kind": "struct",
"fields": [
{ "name": "id", "type": { "array": ["u8", 32] } },
{ "name": "action_bytes", "type": "bytes" },
{ "name": "vote_count", "type": "u8" },
{ "name": "executed", "type": "bool" },
{ "name": "spent_nullifiers", "type": { "vec": { "array": ["u8", 32] } } }
]
}
}
],
"errors": [
{ "code": 6001, "name": "ProofInvalid", "msg": "multisig state deserialize failed" },
{ "code": 6002, "name": "MultisigMismatch", "msg": "multisig id mismatch" },
{ "code": 6003, "name": "ProposalNotFound", "msg": "proposal not found" },
{ "code": 6004, "name": "NullifierSpent", "msg": "nullifier already spent (double vote)" },
{ "code": 6005, "name": "MemberNotRegistered", "msg": "nsk does not match registered commitment / index out of range" },
{ "code": 6006, "name": "ProposalAlreadyExecuted", "msg": "proposal already executed" },
{ "code": 6007, "name": "ThresholdNotMet", "msg": "threshold not met" },
{ "code": 6008, "name": "AlreadyInitialized", "msg": "multisig account already initialized / duplicate proposal id" },
{ "code": 6009, "name": "TooManyMembers", "msg": "more than MAX_MEMBERS commitments" },
{ "code": 6010, "name": "InvalidThreshold", "msg": "threshold must be 1..=N" },
{ "code": 6011, "name": "TooManyProposals", "msg": "more than MAX_PROPOSALS proposals" },
{ "code": 6012, "name": "RiderMismatch", "msg": "rider is not the voting account derived from this nsk" },
{ "code": 6013, "name": "RiderNotLive", "msg": "rider must be a live shielded account" }
]
}