You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/signer-api.yml
+76-7Lines changed: 76 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ paths:
60
60
61
61
/signer/v1/request_signature:
62
62
post:
63
-
summary: Send a signature request
63
+
summary: Request a signature for a 32-byte blob of data (typically a hash), signed by the requested BLS or ECDSA key.
64
64
tags:
65
65
- Signer
66
66
security:
@@ -81,15 +81,15 @@ paths:
81
81
type: string
82
82
enum: [consensus, proxy_bls, proxy_ecdsa]
83
83
pubkey:
84
-
description: Public keyof the validator for consensus signatures
84
+
description: The 48-byte BLS public key, with optional `0x` prefix, of the proposer key that you want to request a signature from.
85
85
$ref: "#/components/schemas/BlsPubkey"
86
86
proxy:
87
-
description: BLS proxy pubkey or ECDSA address for proxy signatures
87
+
description: The 48-byte BLS public key (for `proxy_bls` mode) or the 20-byte Ethereum address (for `proxy_ecdsa` mode), with optional `0x` prefix, of the proxy key that you want to request a signature from.
88
88
oneOf:
89
89
- $ref: "#/components/schemas/BlsPubkey"
90
90
- $ref: "#/components/schemas/EcdsaAddress"
91
91
object_root:
92
-
description: The root of the object to be signed
92
+
description: The 32-byte data you want to sign, with optional `0x` prefix.
description: A successful signature response. The returned signature is the Merkle root hash of the provided `object_root` field and the requesting module's Signing ID as specified in the Commit-Boost configuration. For details on this signature, see the [signature structure documentation](https://commit-boost.github.io/commit-boost-client/developing/prop-commit-signing.md#structure-of-a-signature).
- You requested an operation while using the Dirk signer mode instead of locally-managed signer mode, but Dirk doesn't support that operation.
134
+
- Something went wrong while preparing your request; the error text will provide more information.
135
+
content:
136
+
application/json:
137
+
schema:
138
+
type: object
139
+
required:
140
+
- code
141
+
- message
142
+
properties:
143
+
code:
144
+
type: number
145
+
example: 400
146
+
message:
147
+
type: string
148
+
example: "Bad request: Invalid pubkey format"
149
+
"401":
150
+
description: The requesting module did not provide a JWT string in the request's authorization header, or the JWT string was not configured in the signer service's configuration file as belonging to the module.
151
+
content:
152
+
application/json:
153
+
schema:
154
+
type: object
155
+
required:
156
+
- code
157
+
- message
158
+
properties:
159
+
code:
160
+
type: number
161
+
example: 401
162
+
message:
163
+
type: string
164
+
example: "Unauthorized"
165
+
129
166
"404":
130
-
description: Unknown value (pubkey, etc.)
167
+
description: You either requested a route that doesn't exist, or you requested a signature from a key that does not exist.
131
168
content:
132
169
application/json:
133
170
schema:
@@ -142,8 +179,24 @@ paths:
142
179
message:
143
180
type: string
144
181
example: "Unknown pubkey"
182
+
"429":
183
+
description: Your module attempted and failed JWT authentication too many times recently, and is currently timed out. It cannot make any more requests until the timeout ends.
184
+
content:
185
+
application/json:
186
+
schema:
187
+
type: object
188
+
required:
189
+
- code
190
+
- message
191
+
properties:
192
+
code:
193
+
type: number
194
+
example: 429
195
+
message:
196
+
type: string
197
+
example: "Too many requests"
145
198
"500":
146
-
description: Internal error
199
+
description: Your request was valid, but something went wrong internally that prevented it from being fulfilled.
147
200
content:
148
201
application/json:
149
202
schema:
@@ -158,6 +211,22 @@ paths:
158
211
message:
159
212
type: string
160
213
example: "Internal error"
214
+
"502":
215
+
description: The signer service is running in Dirk signer mode, but Dirk could not be reached.
216
+
content:
217
+
application/json:
218
+
schema:
219
+
type: object
220
+
required:
221
+
- code
222
+
- message
223
+
properties:
224
+
code:
225
+
type: number
226
+
example: 502
227
+
message:
228
+
type: string
229
+
example: "Bad gateway: Dirk signer service is unreachable"
Copy file name to clipboardExpand all lines: docs/docs/developing/prop-commit-signing.md
-115Lines changed: 0 additions & 115 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,118 +58,3 @@ where:
58
58
The data signed in a proposer commitment is the 32-byte root of this tree (the green `Root` box). Note that calculating this will involve calculating the Merkle Root of two separate trees: first the blue data subtree (with the original request data and the signing ID) to establish the blue `Root` value, and then again with a tree created from that value and the `Domain`.
59
59
60
60
Many languages provide libraries for computing the root of an SSZ Merkle tree, such as [fastssz for Go](https://github.com/ferranbt/fastssz) or [tree_hash for Rust](https://docs.rs/tree_hash/latest/tree_hash/). When verifying proposer commitment signatures, use a library that supports Merkle tree root hashing, the `compute_domain()` operation, and validation for signatures generated by your key of choice.
61
-
62
-
63
-
## Requesting a Proposer Commitment from the Signer
64
-
65
-
Prior to requesting a signature from the signer service, first ensure that Commit Boost has been [configured](#configuring-a-module-for-proposer-commitments) with your module's signing ID and JWT secret.
66
-
67
-
The signer service can be accessed by an HTTP API. In Docker mode, this will be within the `cb_signer` container at the `/signer/v1/request_signature` route (for example, using the default port of `20000`, the endpoint will be `http://cb_signer:20000/signer/v1/request_signature`). Submitting a request must be done via the `POST` method.
68
-
69
-
70
-
### Headers
71
-
72
-
- Set `Content-Type` set to `application/json`.
73
-
- Set `Accept` to `application/json`, as responses are quoted strings. Other formats are not currently supported.
74
-
- Set `Authorization` to a standard JWT string representing your module's JWT authentication information. For the claims, you can add a `module` claim indicating the human-readable name of your module.
75
-
76
-
77
-
### BLS Proposer Keys
78
-
79
-
If requesting a signature directly from a proposer pubkey, use the following body specification:
80
-
81
-
```json
82
-
{
83
-
"type": "consensus",
84
-
"pubkey": "0x1234abcd...",
85
-
"object_root": "0x01020304..."
86
-
}
87
-
```
88
-
89
-
where:
90
-
91
-
-`pubkey` is the 48-byte BLS public key, with optional `0x` prefix, of the proposer key that you want to request a signature from.
92
-
-`object_root` is the 32-byte data you want to sign, with optional `0x` prefix.
93
-
94
-
95
-
### BLS Proxy Keys
96
-
97
-
If requesting a signature indirectly from a proposer key via a [proxy key](./commit-module.md#with-a-proxy-key), use the following body specification:
98
-
99
-
```json
100
-
{
101
-
"type": "proxy_bls",
102
-
"proxy": "0x1234abcd...",
103
-
"object_root": "0x01020304..."
104
-
}
105
-
```
106
-
107
-
where:
108
-
109
-
-`proxy` is the 48-byte BLS public key, with optional `0x` prefix, of the proxy key that you want to request a signature from.
110
-
-`object_root` is the 32-byte data you want to sign, with optional `0x` prefix.
111
-
112
-
113
-
### ECDSA Proxy Keys
114
-
115
-
**NOTE:** ECDSA proxy key support is not available when using Dirk.
116
-
117
-
If requesting a signature indirectly from an Ethereum private key via a [proxy key](./commit-module.md#with-a-proxy-key), use the following body specification:
118
-
119
-
```json
120
-
{
121
-
"type": "proxy_ecdsa",
122
-
"proxy": "0x1234abcd...",
123
-
"object_root": "0x01020304..."
124
-
}
125
-
```
126
-
127
-
where:
128
-
129
-
-`proxy` is the 20-byte Ethereum address of the proxy key, with optional `0x` prefix, of the ECDSA private key that you want to request a signature from.
130
-
-`object_root` is the 32-byte data you want to sign, with optional `0x` prefix.
131
-
132
-
133
-
### Response
134
-
135
-
The response for any of the above will be one of the following, provided in plaintext format (not JSON).
136
-
137
-
138
-
#### `200 OK`
139
-
140
-
A successful signing request, with the signature provided as a plaintext quoted hex-encoded string, with a `0x` prefix. For example, the response body would look like:
Your module did not provide a JWT string in the request's authorization header, or the JWT string was not configured in the signer service's configuration file as belonging to your module.
148
-
149
-
150
-
#### `400 Bad Request`
151
-
152
-
This can occur in several scenarios:
153
-
154
-
- You requested an operation while using the Dirk signer mode instead of locally-managed signer mode, but Dirk doesn't support that operation.
155
-
- Something went wrong while preparing your request; the error text will provide more information.
156
-
157
-
158
-
#### `502 Bad Gateway`
159
-
160
-
The signer service is running in Dirk signer mode, but Dirk could not be reached.
161
-
162
-
163
-
#### `404 Not Found`
164
-
165
-
You either requested a route that doesn't exist, or you requested a signature from a key that does not exist.
166
-
167
-
168
-
#### `429 Too Many Requests`
169
-
170
-
Your module attempted and failed JWT authentication too many times recently, and is currently timed out. It cannot make any more requests until the timeout ends.
171
-
172
-
173
-
#### `500 Internal Server Error`
174
-
175
-
Your request was valid, but something went wrong internally that prevented it from being fulfilled.
0 commit comments