live · mainnetoc · docs
specs · api · guides
docs / specification

Specification

The normative spec is one repo, four documents, twenty-eight conformance vectors:

DocumentWhat it covers
SPEC.mdNormative rules — canonical message, envelopes, state machine, errors
PROTOCOL.mdFlow diagrams, discovery patterns, relay semantics
NIP_ORANGECHECK_PLEDGE.mdNostr kind-30078 d-tag namespaces + discovery filters
REGISTRY.mdResolution mechanisms, extension policy, change process
WHY.mdDesign rationale + the rejected-design log
SECURITY.mdThreat model, verifier obligations, mitigations
/test-vectors/28 conformance vectors — required-pass for any impl
/examples/Three runnable example envelopes

License: spec CC-BY-4.0, examples MIT.

Conformance vectors

Twenty-eight vectors at v0.1:

GroupVectorsCoverage
Resolution mechanismsv01–v07One happy-path vector per mechanism (chain_statevote_resolves)
Agent delegationv08Pledge signed by an agent under pledge:create delegation scope
Edge casesv09–v10resolves_at == expires_at, same-block resolve
Outcome envelope shapesv11–v16One per mechanism — deterministic and resolver-signed
Abandonmentv17Abandonment envelope, classification = broken
Bond verificationv18–v20Valid, invalid, and spent-mid-pledge
Bilateral consistencyv21–v22Both parties consistent vs contradictory
State-machine transitionsv23–v27All 5 transition classes from §2.4 of the brief
Malformed-input rejectionv28Empty nonce — implementation MUST reject before computing canonical

Every vector is a (inputs, expected_outputs) JSON tuple. Implementations ship a harness that runs all vectors and reports pass/fail. CI must run the harness; a new implementation joins the family by passing all vectors byte-identically.

The TypeScript and Python SDKs are required to produce byte-identical canonical messages, ids, and signatures. Same discipline orangecheck and @orangecheck/sdk already follow.

Versioning policy

The canonical message header oc-pledge/v1 commits incompatible changes to explicit version bumps. Adding a new resolution mechanism is a MINOR version (existing pledges still verify); changing field order or serialization is MAJOR (existing pledges may need re-canonicalization in clients).

The protocol freezes the canonical-message format at v1.0.0 once GA criteria are met (see CHANGELOG). Future MINOR bumps add fields without breaking existing verifiers; future MAJOR bumps require coordinated upgrade across the family.

See also