How It Works
A wallet owner signs a message authorizing 1-100% of their BTC rewards to flow to a delegate pubkey. The delegation remains active until explicitly revoked. Constraints:- One active delegation per wallet
- Cannot delegate to yourself
- Percentage must be 1-100
- Signed messages expire after 5 minutes
Message Formats
Delegation:Date.now()). Messages are valid for 5 minutes from the nonce timestamp.
API Reference
GET /v1/delegation/:pubkey
GET /v1/delegation/:pubkey
Check if a wallet has an active delegation.Response (no delegation):Response (active delegation):
POST /v1/delegation
POST /v1/delegation
Create or update a delegation. Replaces any existing delegation.Request body:Response:
POST /v1/delegation/revoke
POST /v1/delegation/revoke
Revoke an active delegation.Request body:Response:
Code Example
Error Responses
| Status | Error | Cause |
|---|---|---|
| 400 | Invalid delegator | Pubkey format invalid (must be 66-char hex) |
| 400 | Invalid delegate | Delegate pubkey format invalid |
| 400 | Invalid message format | Message doesn’t match expected format |
| 400 | Delegate pubkey mismatch | Message delegate doesn’t match request body |
| 400 | Percentage mismatch | Message percentage doesn’t match request body |
| 400 | Nonce expired or invalid | Nonce older than 5 minutes or in the future |
| 400 | Cannot delegate to self | Delegator and delegate are the same pubkey |
| 401 | Invalid signature | Signature verification failed |
| 404 | No active delegation found | Revoke called with no active delegation |