How OC Pledge works
Three signed artifacts, byte-identical across implementations:
- Pledge envelope — the swearer's commitment. BIP-322-signed.
- Outcome envelope — the resolution. Either deterministic (no signature) or signed by a designated resolver.
- Abandonment envelope (optional) — the swearer's pre-resolution
admission of break. Counts as
brokenin the public ledger.
The canonical pledge messageLink to this section
The bytes the swearer signs are deterministic and human-readable. The user must be able to read them in their wallet's signing prompt and understand what they're committing to.
oc-pledge/v1
swearer: bc1qexampleaddress…
proposition: I will publish my Q3 results by block 920000.
resolution:
mechanism: stamp_published
query: stamp(content_hash=sha256:7d…, signer=bc1qexampleaddress…)
resolves_at:
block: 920000
expires_at: 2026-08-01T00:00:00Z
bond:
attestation_id: 84ad…
min_sats: 1000000
min_days: 90
counterparty: null
dispute:
mechanism: null
params: null
remediation: breach_recorded
sworn_at: 2026-04-25T15:00:00Z
nonce: 7af3b2c149e87fa1c6d2eb5403f8a0d9
Canonical-serialization rules (see
SPEC §3 (opens in a new tab)):
UTF-8, LF only, no trailing whitespace, exact field order, decimal integers
without leading zeros, ISO-8601 UTC Z timestamps, addresses in their canonical
bech32 / legacy form. Byte-exact serialization is a conformance requirement.
pledge_id := sha256(canonical_message_bytes) // hex-lowercase
The seven resolution mechanismsLink to this section
Fixed at v1.0. No extensions without working integrator code demonstrating the need.
| Mechanism | Resolution outcome is computed from… | Determines outcome offline? |
|---|---|---|
chain_ | Bitcoin RPC against a small canonical DSL | yes |
counterparty_ | a BIP-322 signature from the named counterparty | no — needs resolver |
nostr_ | a Nostr query against ≥ 2 relays from the default set | yes |
stamp_ | a lookup of an OC Stamp envelope by content hash and signer | yes |
http_ | SHA-256 of the response body of a specified URL | yes |
dns_ | a DoH query for a specified record from a resolver set | yes |
vote_ | the tally of a named OC Vote poll above a threshold | yes |
Every mechanism produces a deterministic boolean outcome given fixed public state. The SDK refuses any combination that can't.
There is no self_proof mechanism. This is a deliberate refusal — see
Why and the
REGISTRY (opens in a new tab)
for the long argument.
Full grammar for each: Resolution grammar.
The outcome envelopeLink to this section
Paired with the pledge, published as a Nostr kind-30078 replaceable event under
d-tag oc-pledge-outcome:<pledge_id>.
oc-pledge-outcome/v1
pledge_id: <sha256 of pledge canonical message>
outcome: kept | broken | expired_unresolved | disputed
resolved_at: <ISO-8601 UTC>
resolved_by: <address | 'deterministic'>
evidence:
mechanism: <same as pledge>
result: <canonical query output>
witness: <chain_height + chain_hash | nostr_event_id | http_response_hash | dns_response | counterparty_sig | vote_poll_id>
dispute_window_ends_at: <ISO-8601 UTC>
The envelope's sig is not part of this canonical message: it is a base64
BIP-322 signature from resolved_by over the outcome id, or null for a
deterministic outcome.
For deterministic mechanisms — chain_state, nostr_event_exists,
stamp_published, http_get_hash, dns_record, vote_resolves — every
verifier independently produces the byte-identical outcome envelope. No
resolver is required and sig is null. This is the property that makes Pledge
gas-free: anyone can resolve, no one needs permission.
For counterparty_signs, the outcome requires a BIP-322 signature from the
counterparty. Absence of that signature within expires_at →
expired_unresolved.
A pledge is disputed when the resolver contradicts itself inside the earliest
settling outcome's window, or, on a counterparty_signs pledge, when the
swearer counter-claims against the counterparty's outcome at any time before
expires_at. A counter-claim never settles a pledge. A disputed pledge that
names a dispute mechanism stays disputed until that mechanism resolves it. One
that names none times out to expired_unresolved at expires_at.
The abandonment envelopeLink to this section
A swearer who wants to exit gracefully publishes:
oc-pledge-abandonment/v1
pledge_id: <sha256>
abandoned_at: <ISO-8601 UTC>
reason: <one line; the signer writes at most 280 UTF-8 bytes>
The envelope's sig is a base64 BIP-322 signature from the swearer over the
abandonment id. A verifier does not refuse a reason for its length.
Abandonment counts as broken in the public ledger. No "honorable exit"
classification. The reason field is informational; the ledger is binary. This is
a pressure-tested decision — any "honorable abandonment" status creates a
race-to-abandon attack where swearers dodge foreseeable failures by admitting
them slightly earlier.
How the outcome is foundLink to this section
Verifiers query Nostr by d-tag pattern:
oc-pledge:<pledge_id>— the pledgeoc-pledge-outcome:<pledge_id>— the outcomeoc-pledge-abandonment:<pledge_id>— the abandonment
The default relay set is the family's, from @orangecheck/nostr-core;
integrators can override. A verifier asks at least two relays and finds an event
if any of them returns one that verifies. A missing outcome counts as absent
only at the read floor of the relays asked (four of five), all answering in full
with none cut off; otherwise the state is unchecked (SPEC §11 item 15).
See alsoLink to this section
- State machine —
pending → resolvable → kept | broken | disputed | expired_unresolved. - Resolution grammar — full DSL per mechanism.
- Composition with the family — Stamp, Vote, Agent, Lock integrations.
- Specification — normative rules.