Status & error codes
Every verification path — hosted API, SDKs, CLI — returns results as a flat list
of status codes. Success codes (sig_ok_bip322, bond_confirmed) sit
alongside failure codes (sig_invalid, expired) in the same shape, so your
gate can log one canonical stream instead of branching on ok: true | false.
This page is the single source of truth. If you see a code that isn't here, it's a bug — open an issue.
The response shapeLink to this section
A verification returns the same envelope on all three surfaces (/api/verify,
the SDKs' verify(), oc verify --json):
{
"ok": true,
"codes": ["sig_ok_bip322", "bond_confirmed"],
"network": "mainnet",
"attestation_id": "a3f5b8c2...",
"metrics": { "sats_bonded": 125000, "days_unspent": 47, "score": 30.12 }
}
attestation_id, identities and metrics are present when the verifier could
derive them.
ok: true iff every signature code is a success AND thresholds are met.
codes[] is the ordered list of everything the verifier observed — always
present, even on success.
Signature codesLink to this section
| Code | Severity | Meaning | What to tell the user |
|---|---|---|---|
sig_ | success | A BIP-322 simple signature, with or without smp, valid against the declared address. | — |
sig_ | success | A 65-byte legacy signmessage (BIP-137) signature valid against the declared address, on any address type: P2PKH, P2SH-P2WPKH, P2WPKH or P2TR. | — |
sig_ | error | Signature does not match message + address. A valid legacy signature from another key is this too. | "The signature does not match the message and address. Common issues: (1) the message was not copied exactly, (2) a different address signed it, (3) the wallet signed on another network." |
sig_ | error | A BIP-322 full or proof-of-funds signature (ful, pof), refused unread. Before sdk 1.16.0 it meant a legacy signature on a SegWit address. | "Your wallet made a BIP-322 full or proof-of-funds signature. Sign with a BIP-322 simple signature, or with legacy message signing, which every address type here accepts." |
invalid_ | error | Not sent from sdk 1.16.0: the signature's bytes decide the scheme, and the scheme input is ignored. Older verifiers sent it for a scheme that was neither bip322 nor legacy. | "Use a supported signing scheme." |
decode_ | error | Canonical message could not be parsed — malformed header, wrong line endings, bad base64. | "Copy the full canonical message from Step 2 without modification. LF line endings only, one trailing newline." |
invalid_ | error | attestation_ does not equal sha256(. | "This attestation has been tampered with. Refuse it." |
The sign-in check, verifyChallenge, answers with a reason of its own. It
refuses a full or proof-of-funds signature as sig_unsupported_scheme, and on
success returns scheme: 'bip322' | 'legacy', read from the signature. Its
scheme option is deprecated and ignored. Which forms each address type accepts
is on BIP-322.
Bond / chain-state codesLink to this section
| Code | Severity | Meaning | What to tell the user |
|---|---|---|---|
bond_ | success | Confirmed UTXOs found at the address; sats_ and days_ are derivable. | — |
bond_ | warn | Address has no confirmed UTXOs. Signature is still valid — the bond just doesn't exist. | "Send sats to this address and wait for one confirmation before retrying." |
bond_ | info | Address has only unconfirmed transactions. | "Wait for the first confirmation (≈10 min)." |
bond_ | error | Declared bond: extension exceeds the confirmed balance. | "Lower your declared bond, or fund the address up to the declared amount." |
bond_ | error | The signed bond: line is not a whole number of sats in plain digits, so the attestation does not say how much it bonds. | "Sign again with the bond written as a whole number of sats." |
Policy / threshold codes (returned by /api/check)Link to this section
These are emitted in addition to the signature/bond codes above, when an
/api/check call has threshold parameters (min_sats, min_days).
| Code | Severity | Meaning |
|---|---|---|
below_ | error | sats_. |
below_ | error | days_. |
When /api/check returns ok: false, these appear under a separate reasons
key so your error handler can switch on the cause:
{
"ok": false,
"sats": 50000,
"days": 12,
"reasons": ["below_min_sats", "below_min_days"]
}
Context codesLink to this section
| Code | Severity | Meaning | What to tell the user |
|---|---|---|---|
aud_ | warn | audience in the signed message doesn't match what the verifier expected. | Usually means the signature was made for a different host — verify-intentional or refuse, your choice. |
expired | error | The signed expires has passed or is not an RFC 3339 time; for a sign-in challenge, its expires_. | "This has expired. Sign a fresh one." |
not_ | error | The signed issued_ is more than two minutes ahead of the verifier's clock. | "This is dated in the future. Check the clock that signed it, then sign again." |
network_ | warn | Signature is on testnet or signet. | "Test networks can't be verified in production. Use mainnet." |
bad_ | error | Structural problem with the request body — missing fields, wrong types. | "Check your request shape against the docs." |
Programmatic accessLink to this section
The full table above is shipped as a typed record in the JS SDK:
import type { StatusCode } from '@orangecheck/sdk';
import { STATUS_META } from '@orangecheck/sdk';
const meta = STATUS_META['sig_invalid'];
// → { label: 'Signature verification failed', detail: '...', severity: 'error' }
Use STATUS_META[code].label for short headlines and .detail for the verbose
user-facing message. The severity field
('success' | 'info' | 'warn' | 'error') lets your UI apply the right visual
treatment without branching on string keys.
The Python SDK has no STATUS_META; use the code strings in this table.
HTTP status vs. status codeLink to this section
The HTTP status says whether the request was processable; the codes[] field
says what the verification actually found. Do not conflate them.
| HTTP | Meaning |
|---|---|
200 | Request was valid and the verifier ran. ok and codes tell you what happened. |
400 | Request shape was wrong — missing addr, malformed JSON, etc. codes may be absent. |
401 | / rejected the session (e.g. not_). |
403 | Cross-site POST to a browser-only endpoint. |
404 | / subject lookup returned no attestation. |
429 | Rate limit hit. attest.ochk.io sends no Retry-: wait a minute. See errors by host. |
500 | Verifier crashed. Open an issue. |
FurtherLink to this section
/api/checkreference — the main consumer of these codes./api/verifyreference — raw verification, returns the same shape.- Verification concept — the algorithm that produces these codes.
- Security implications — what to do when specific codes appear.