200 OK, the operation proceeds. Any other response rejects it.
This gives you full control over which operations your signers are allowed to perform, based on your own business logic.
How it works
Signer receives a request
A signing or key export request reaches the signer through the normal Dfns flow.
Signer calls your validation gate handler
Before performing the operation, the signer sends an HTTP
POST request with a JSON body to the URL you configured. The payload contains information about the operation (see Request payload below).Your handler decides
Your handler inspects the payload and returns:
200 OKto approve the operation- Any other status code to reject it
Request payload
Your handler receives aPOST request with a JSON body.
signerInfo fields
The signerInfo object contains trusted information provided by the signer itself. These values are derived from the signer’s own state and are not user-supplied.
| Field | Type | Description |
|---|---|---|
kind | "Signing" or "KeyExport" | The type of operation being performed. |
key_id | string | ID of the key being used. |
public_key | string | Hex-encoded public key associated with the key. |
tx_hash | string (optional) | Hex-encoded hash of the transaction to be signed. Present for signing requests, absent for key exports. |
derivation_path | array of numbers (optional) | HD derivation path, when the key uses hierarchical derivation. |
child_public_key | string (optional) | Hex-encoded child public key derived from the master key using the derivation_path. Present only when derivation_path is set. |
Examples
Signing request with HD derivation:Response handling
Your handler must return200 OK to approve the operation. The signer treats any other response as a rejection:
| Your handler returns | Signer behavior |
|---|---|
200 OK | Operation approved. Signer proceeds. |
400 Bad Request | Rejected. Treated as an authentication error. |
401 Unauthorized | Rejected. Treated as an authentication error. |
| Any other non-200 status | Rejected. Treated as permission denied. |
| Connection failure | Rejected. Treated as an internal error. |
