Skip to content

Commit da550d3

Browse files
committed
chore(docs): update md files in book
1 parent f103c8d commit da550d3

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ async fn main() {
5151
let pubkey = *pubkeys.consensus.first().unwrap();
5252

5353
let datagram = Datagram { data: 42 };
54-
let request = SignRequest::builder(pubkey).with_msg(&datagram);
54+
let request = SignConsensusRequest::builder(pubkey).with_msg(&datagram);
5555
let signature = config
5656
.signer_client
57-
.request_signature(&request)
57+
.request_consensus_signature(&request)
5858
.await
5959
.unwrap();
6060

docs/docs/developing/commit-module.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The loaded `config` also has a few other useful fields:
4646

4747

4848
## Requesting signatures
49-
At its core the Signer Module simply provides a signature on a 32-byte data digest. The signatures are currently provided with either the validator keys (BLS) or a proxy key (also BLS) for a given validator key, both on the [builder domain](https://github.com/Commit-Boost/commit-boost-client/blob/main/crates/common/src/signature.rs#L88-L96). Eventually we plan to support [alternative](https://github.com/Commit-Boost/commit-boost-client/issues/20) signing schemes, too.
49+
At its core the Signer Module simply provides a signature on a 32-byte data digest. The signatures are currently provided with either the validator keys (BLS) or a proxy key (BLS or ECDSA) for a given validator key, both on the [builder domain](https://github.com/Commit-Boost/commit-boost-client/blob/main/crates/common/src/signature.rs#L88-L96).
5050

5151
In the example we use `TreeHash`, already used in the CL, to create the digest from a custom struct:
5252
```rust
@@ -69,26 +69,37 @@ Then, we can request a signature either with a consensus key or with a proxy key
6969
Requesting a signature is as simple as:
7070
```rust
7171
let datagram = Datagram { data: 1 };
72-
let request = SignRequest::builder(pubkey).with_msg(&datagram);
73-
let signature = config.signer_client.request_signature(&request).await.unwrap();
72+
let request = SignConsensusRequest::builder(pubkey).with_msg(&datagram);
73+
let signature = config.signer_client.request_consensus_signature(&request).await.unwrap();
7474
```
7575

7676
Where `pubkey` is the validator (consensus) public key for which the signature is requested.
7777

7878
### With a proxy key
79-
You'll have to first request a proxy key be generated for a given consensus key:
79+
You'll have to first request a proxy key be generated for a given consensus key.
80+
We support two signature schemes for proxies: BLS or ECDSA.
81+
82+
To request a proxy:
8083
```rust
81-
let proxy_delegation = self.config.signer_client.generate_proxy_key(pubkey).await?;
84+
// BLS proxy
85+
let proxy_delegation = self.config.signer_client.generate_proxy_key_bls(pubkey).await?;
86+
let proxy_pubkey = proxy_delegation.message.proxy;
87+
88+
// or ECDSA proxy
89+
let proxy_delegation = self.config.signer_client.generate_proxy_key_ecdsa(pubkey).await?;
8290
let proxy_pubkey = proxy_delegation.message.proxy;
8391
```
8492

8593
Where `pubkey` is the validator (consensus) public key for which a proxy is to be generated.
8694

87-
Then, the only difference from the direct approach is explicitly saying that the signature request uses a proxy key:
95+
Then you can use the generated proxy key to request a signature:
8896
```rust
8997
let datagram = Datagram { data: 1 };
90-
let request = SignRequest::builder(proxy_pubkey).is_proxy().with_msg(&datagram);
91-
let signature = config.signer_client.request_signature(&request).await.unwrap();
98+
let request = SignProxyRequest::builder(proxy_pubkey).with_msg(&datagram);
99+
// if `proxy_pubkey` is a BLS proxy
100+
let signature = config.signer_client.request_proxy_signature_bls(&request).await.unwrap();
101+
// or for ECDSA proxy
102+
let signature = config.signer_client.request_proxy_signature_ecdsa(&request).await.unwrap();
92103
```
93104

94105
## Metrics

0 commit comments

Comments
 (0)