Skip to content

Commit ada4225

Browse files
authored
Merge pull request #66 from Alex-ssvlabs/main
Breakdown of keyshares
2 parents 3093e77 + 4df7fb7 commit ada4225

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

docs/developers/tools/ssv-dkg-client/ceremony-output-summary.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,53 @@ ceremony-[timestamp]
6060

6161
#### How `proofs` secure the ceremony for both parties:
6262
- Owner/initiator can't change their owner address, because the address is part of proof's content and this is signed by operator's private key.
63-
- Operator signs the proof with their private key and the proof itself has their public key which can be used to verify the signature.
63+
- Operator signs the proof with their private key and the proof itself has their public key which can be used to verify the signature.
64+
65+
### Keyshares
66+
#### An example of `keyshares.json` structure:
67+
```json
68+
{
69+
"version": "v1.1.0",
70+
"createdAt": "2025-05-14T10:23:43.794Z",
71+
"shares": [
72+
{
73+
"data": {
74+
"ownerNonce": 0,
75+
"ownerAddress": "OWNER_ADDRESS",
76+
"publicKey": "VALIDATOR_PUBKEY",
77+
"operators": [
78+
{
79+
"id": 1,
80+
"operatorKey": "OPERATOR_PUBKEY"
81+
},
82+
{...},
83+
{...},
84+
{...}
85+
]
86+
},
87+
"payload": {
88+
"publicKey": "VALIDATOR_PUBKEY",
89+
"operatorIds": [1,2,3,4],
90+
"sharesData": "ENCRYPTED_SHARES_DATA"
91+
}
92+
}
93+
]
94+
}
95+
```
96+
97+
#### Details about `sharesData` field
98+
Below is an example of `sharesData` from a Hoodi validator broken down:
99+
100+
<div style={{ textAlign: 'center', width: '100%', margin: '0 auto' }}>
101+
<img src="/img/sharesData.png" alt="" />
102+
</div>
103+
104+
#### Explanation of each segment:
105+
- <span style={{ color: 'black', backgroundColor: '#d4d4d4', fontWeight: 'bold' }}>Signature</span> - First 192 characters (excluding `0x`) is a serialized BLS signed message ([read more about SSZ here](https://ethereum.org/en/developers/docs/data-structures-and-encoding/ssz/)). The message itself is `ownerAddress:ownerNonce`, it's signed by the validator private key and consequently can be verified using validator's `publicKey`.
106+
- <span style={{ color: 'black', backgroundColor: '#bad6a7', fontWeight: 'bold' }}>Share</span><span style={{ color: 'black', backgroundColor: '#fbe6a2', fontWeight: 'bold' }}>s' pu</span><span style={{ color: 'black', backgroundColor: '#de9d9b', fontWeight: 'bold' }}>blic </span><span style={{ color: 'black', backgroundColor: '#aac1f0', fontWeight: 'bold' }}>keys</span> - An array of concatenated BLS public keys. Each element is a public share of a validator's key and is 96 characters long. The number of shares depends on the number of chosen operators.
107+
- <span style={{ color: 'black', backgroundColor: '#dce9d5', fontWeight: 'bold' }}>Encr</span><span style={{ color: 'black', backgroundColor: '#fcf5d9', fontWeight: 'bold' }}>ypte</span><span style={{ color: 'black', backgroundColor: '#edcece', fontWeight: 'bold' }}>d sh</span><span style={{ color: 'black', backgroundColor: '#d5e0f5', fontWeight: 'bold' }}>ares</span> - An array of concatenated BLS encrypted keys. Each element is a private share of a validator's key and is 512 characters long. The number of shares depends on the number of chosen operators. Shares are encrypted with each operator's public key and can only be decrypted with the respective private key.
108+
109+
**If you want to learn more about keyshare verification**, you can dissect [verify-keyshare repository on GitHub](https://github.com/RaekwonIII/verify-keyshares):
110+
- `validateSingleShares` function in `ssv-keys.ts` does the signature verification.
111+
- `buildSharesFromBytes` function breaks down each operators' keyshare.
112+
- `areKeysharesValid` function then checks the signature and operators' keyshares agains the validator public key.

static/img/sharesData.png

429 KB
Loading

0 commit comments

Comments
 (0)