The wallet signed the challenge
At sign-inA one-time challenge is signed in the wallet. Later requests present the pass; they are not signed one by one.
How sign-in works →A partner signs in with a Bitcoin wallet. TOKENLOCK checks that the wallet holds the required Token, then your server enforces the permissions you set. Give an agent read access to reports, keep admin actions restricted, and revoke its key when the engagement ends.
A partner research agent at a Bitcoin data provider.
| The agent’s request | What the provider sees |
|---|---|
Read a licensed report · GET /reports |
Allowed: the agent has read access. |
Modify a report · POST /reports |
Denied: the grant permits reads only. |
| Read the report after its key is revoked | Denied on the next strict hosted check. |
Three checks, each independent. Missing or unclear authority means no access.
A one-time challenge is signed in the wallet. Later requests present the pass; they are not signed one by one.
How sign-in works →TOKENLOCK checks holdings at sign-in, and again on a hosted verify at most every 300 seconds (five minutes) by default.
Holdings checks →You grant a key specific routes, methods, and environments. A request with no matching policy is denied.
See policies →You can set the holdings re-check interval with recheck_holdings_s, or turn re-checks off (0) so holdings are read only at sign-in.
The simplest supported path is the agent’s own Bitcoin wallet. A person can also sign in the same way with a registered employee or vendor wallet; that enrollment path is in the enrollment docs.
Register the agent’s Bitcoin wallet as a key (POST /access/keys, or Add key in the dashboard) with owner type agent. The agent’s wallet signs a one-time sign-in challenge. A key an administrator registers is active immediately.
Sign-in returns a short-lived pass (15 minutes by default for agent keys; set agent_pass_ttl_s or per-key pass_ttl_s, from 60 seconds). The agent stores that pass and sends it on later API calls. The SDK middleware and getPass read it from the tokenlock_pass cookie. Your server can also take the pass from the request and call verifyPass or authorize with the path, method, and environment. We do not host your pages.
Turn on registered keys. Each grant specifies an allowed route, method, and environment — for example GET /api/reports/* in production.
A pass for that key on GET /api/reports/q3 is allowed:
{
"valid": true,
"allowed": true,
"reason": "ok",
"resource": {
"path": "/api/reports/q3",
"method": "GET",
"environment": "production"
}
}
The same key on POST /api/reports/q3 is denied with method_not_allowed. A path outside the grant is denied with route_not_allowed.
Revoke a registered key, and the next strict hosted check denies access. In self-verify, a revocation applies on the next successful policy refresh (every 60 seconds by default); if refreshes fail, the cached bundle is used until it expires (10 minutes by default), then access fails closed. How long a change takes to apply.