-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtypes.go
121 lines (109 loc) · 3.31 KB
/
types.go
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package spec
type SSZMarshaller interface {
MarshalSSZ() ([]byte, error)
UnmarshalSSZ(buf []byte) error
}
type Operator struct {
ID uint64
PubKey []byte `ssz-max:"2048"`
}
type Init struct {
// Operators involved in the DKG
Operators []*Operator `ssz-max:"13"`
// T is the threshold for signing
T uint64
// WithdrawalCredentials for deposit data
WithdrawalCredentials []byte `ssz-max:"32"`
// Fork ethereum fork for signing
Fork [4]byte `ssz-size:"4"`
// Owner address
Owner [20]byte `ssz-size:"20"`
// Owner nonce
Nonce uint64
// Amount in Gwei (https://eips.ethereum.org/EIPS/eip-7251)
Amount uint64
}
type Reshare struct {
// ValidatorPubKey public key corresponding to the shared private key
ValidatorPubKey []byte `ssz-size:"48"`
// Operators involved in the DKG
OldOperators []*Operator `ssz-max:"13"`
// Operators involved in the resharing
NewOperators []*Operator `ssz-max:"13"`
// OldT is the old threshold for signing
OldT uint64
// NewT is the old threshold for signing
NewT uint64
// Fork ethereum fork for signing
Fork [4]byte `ssz-size:"4"`
// WithdrawalCredentials for deposit data
WithdrawalCredentials []byte `ssz-max:"32"`
// Owner address
Owner [20]byte `ssz-size:"20"`
// Owner nonce
Nonce uint64
// Amount in Gwei (https://eips.ethereum.org/EIPS/eip-7251)
Amount uint64
}
type ReshareMessage struct {
Reshare *Reshare
Proofs []*SignedProof `ssz-max:"13"`
}
type SignedReshare struct {
Messages []*ReshareMessage `ssz-max:"100"`
// Signature is an ECDSA signature over the hash of the resign messages array
Signature []byte `ssz-max:"1536"` // 64 * 24
}
type Resign struct {
// ValidatorPubKey public key corresponding to the shared private key
ValidatorPubKey []byte `ssz-size:"48"`
// Fork ethereum fork for signing
Fork [4]byte `ssz-size:"4"`
// WithdrawalCredentials for deposit data
WithdrawalCredentials []byte `ssz-max:"32"`
// Owner address
Owner [20]byte `ssz-size:"20"`
// Owner nonce
Nonce uint64
// Amount in Gwei (https://eips.ethereum.org/EIPS/eip-7251)
Amount uint64
}
type ResignMessage struct {
Operators []*Operator `ssz-max:"13"`
Resign *Resign
Proofs []*SignedProof `ssz-max:"13"`
}
type SignedResign struct {
Messages []*ResignMessage `ssz-max:"100"`
// Signature is an ECDSA signature over the hash of the resign messages array
Signature []byte `ssz-max:"1536"` // 64 * 24
}
// Result is the last message in every DKG which marks a specific node's end of process
type Result struct {
// Operator ID
OperatorID uint64
// RequestID for the DKG instance (not used for signing)
RequestID [24]byte `ssz-size:"24"`
// Partial Operator Signature of Deposit data
DepositPartialSignature []byte `ssz-size:"96"`
// SSV owner + nonce signature
OwnerNoncePartialSignature []byte `ssz-size:"96"`
// Signed proof for the ceremony
SignedProof SignedProof
}
// Proof for a DKG ceremony
type Proof struct {
// ValidatorPubKey the resulting public key corresponding to the shared private key
ValidatorPubKey []byte `ssz-size:"48"`
// EncryptedShare standard SSV encrypted share
EncryptedShare []byte `ssz-max:"512"`
// SharePubKey is the share's BLS pubkey
SharePubKey []byte `ssz-size:"48"`
// Owner address
Owner [20]byte `ssz-size:"20"`
}
type SignedProof struct {
Proof *Proof
// Signature is an RSA signature over proof
Signature []byte `ssz-size:"256"`
}