Skip to content
On this page

Security

Normative threat model

This page is a summary. The authoritative copy, with every numbered attack scenario, lives in the spec repo.

oc-stamp-protocol/SECURITY.md (opens in a new tab)

Report channelLink to this section

Email security@ochk.io. See SECURITY.md (opens in a new tab) for the full reporting protocol.

What OC Stamp protectsLink to this section

  • Authorship. Only the holder of signer.address's private key could have produced sig.value. BIP-322 assumption.
  • Priority (confirmed anchors only). The envelope id existed on or before the block at ots.block_height. Bitcoin consensus assumption.
  • Integrity. Any tampering with content.hash, content.length, content.mime, signer.address, or signed_at invalidates id and therefore sig.value.
  • Stake (when declared and re-verified). At the moment a verifier resolves stake.attestation_id, the attestation was signed by signer.address and its bond holds against current chain state. stake is outside the id and the signature, so anyone relaying the envelope can strip or swap it; the address check is what stops a swap.

What OC Stamp does NOT protectLink to this section

  • Recency. signed_at is self-declared. Only OTS proves priority before a block, not absolute wall-clock time.
  • Uniqueness. A signer can sign the same content twice with different signed_at. First-stamp ordering relies on ots.block_height, not signed_at.
  • Content liveness. content.ref can 404 or mutate. The hash is authoritative; the pointer is a convenience.
  • Sender anonymity. signer.address is plaintext. For anonymity, sign from a fresh address — but you lose stake signal and identity continuity.
  • Post-quantum confidentiality / authenticity. secp256k1 and SHA-256 have finite lifetimes under sufficiently large quantum computers. No PQ layer in v1.

AssumptionsLink to this section

  • Bitcoin's security model holds. secp256k1 / Schnorr remain unforgeable at current parameter sizes; work-weighted longest chain is canonical.
  • BIP-322 is implemented correctly. Pin a verifier known to handle each address type a signer may use (P2WPKH, P2SH-P2WPKH, P2TR, P2PKH); the spec's vectors v10–v13 carry one real signature for each. @orangecheck/bip322 checks a P2TR signature on the key path only and does not check P2WSH.
  • At least one OTS calendar is non-colluding. Submit to ≥2 independently-operated calendars. @orangecheck/stamp-ots sends to three default calendars (alice, bob, finney) and needs two to answer.
  • SHA-256 is collision-resistant. Practical collisions break id uniqueness.
  • Randomness at signing time is strong for any ephemeral values used by the signing wallet.

Normative compliance requirementsLink to this section

A conformant implementation MUST:

  1. Reconstruct the canonical message from envelope fields before trusting the declared id.
  2. Verify sig.value under BIP-322 before trusting envelope contents.
  3. Verify the OTS anchor against a real Bitcoin block header when ots.status === "confirmed" and the caller attaches legal/economic weight.
  4. Re-resolve any stake claim. Never trust the declared sats_bonded / days_unspent — fetch the attestation, and accept it only if its address is signer.address (checkStake in @orangecheck/stamp-core).
  5. Reject unknown envelope.v values. Preserve unknown optional fields on relay.
  6. Produce byte-identical canonical messages for identical inputs across implementations.
  7. Sign the hex form of id (64 ASCII bytes) with BIP-322, not the raw 32 bytes.

Attack scenarios (selected)Link to this section

The full list of 16 numbered scenarios lives in SECURITY.md (opens in a new tab). Highlights:

  • Envelope tampering in transit — mitigated. Envelope id is H(canonical), committed to by sig.value. stake, ots and content.ref are outside it: ots is checked against Bitcoin, and stake against orangecheck and signer.address.
  • Signature replay across canonical messages — mitigated. oc-stamp:v1 domain separator prevents replay against other orangecheck protocols.
  • Fraudulent OTS proof claiming earlier block — mitigated. Verifiers walk proof to real Bitcoin header.
  • Calendar–miner collusion to backdate — partially mitigated by using multiple independent calendars.
  • Aggregator substitution — mitigated. Aggregator cannot sign; envelope is already signed when submitted.
  • Pending proof used as priority evidence — mitigated by policy and the E_NO_ANCHOR error.
  • content.ref returns attacker-controlled bytes — mitigated. Verifiers fetching via ref MUST re-hash.
  • Key compromise of signer — accepted. Same trust model as BIP-322 everywhere. Rotate to a new address; past stamps remain valid via anchor.

Aggregator-specific risksLink to this section

An aggregator is trusted for liveness only. stamp.ochk.io is not one: its server only forwards each calendar call from your browser, and its verify page upgrades proofs in the browser. The same table applies to that forwarding.

AttackMitigation
Aggregator refuses serviceSubmit directly to calendars
Aggregator drops submissionRe-submit; OTS is idempotent
Aggregator delays pending proofRe-query calendar directly
Aggregator returns fraudulent pending proofCaught at upgrade; the "pending" proof cannot chain to any Bitcoin block
Aggregator modifies a signed fieldInvalidates id, fails signature verification on relay
Aggregator strips or swaps stakeNot signed; the stake check accepts only the signer's own attestation

Dependency postureLink to this section

Narrow surface:

PackagePurpose
@noble/hashesSHA-256
@noble/curvessecp256k1 Schnorr / ECDSA
@orangecheck/stamp-otsOTS proof parsing
@orangecheck/bip322BIP-322 verification

@orangecheck/bip322 is built only on @noble/curves, @noble/hashes and @scure/base: no bitcoinjs-lib, no elliptic. @orangecheck/stamp-cli ≥ 0.2.1 verifies with it, and so does stamp.ochk.io, through @orangecheck/wallet-adapter (0.5.2 and later). bip322-js, which the family used before, stopped verifying on a fresh install once bitcoinjs-lib changed its PSBT checks; don't use it as the verifier.