Keys and Wallets¶
A cluster has one key. Bridges never hold it. They ask a signing agent, which either has the key in a file or uses a wallet.
| Setup | Variables of the signing agent |
|---|---|
| Key file | KEY_FILE, and GENERATE_KEY=true to create it |
| Wallet | WALLET_URL, WALLET_TOKEN |
Signing agent¶
| Method and path | Purpose |
|---|---|
POST /v1/pubkey |
Public key |
POST /v1/sign-event |
Sign an event. Only kinds 30510, 5 and 22242 |
POST /v1/sign-value |
Sign a value of the session protocol |
POST /v1/ecdh |
Shared secret with another key |
Requests need Authorization: Bearer <SIGNER_TOKEN>. Nothing else can be signed, so a compromised bridge cannot use the key for other purposes.
Wallet¶
wallet offers /v1/pubkey, /v1/sign-digest and /v1/ecdh with WALLET_TOKEN. Replace it with your own key management system by implementing these three endpoints.
Public key¶
docker run --rm -i --network none mesh-node:dev pubkey < cluster.key