Security
Normative threat model
This page is a summary. The authoritative copy, with every numbered attack scenario, lives in the spec repo.
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 producedsig.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, orsigned_atinvalidatesidand thereforesig.value. - Stake (when declared and re-verified). At the moment a verifier resolves
stake.attestation_id, the attestation was signed bysigner.addressand its bond holds against current chain state.stakeis 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_atis 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 onots.block_height, notsigned_at. - Content liveness.
content.refcan 404 or mutate. The hash is authoritative; the pointer is a convenience. - Sender anonymity.
signer.addressis 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 all address types (P2WPKH, P2TR, P2WSH, P2PKH).
- At least one OTS calendar is non-colluding. Submit to ≥2
independently-operated calendars.
@orangecheck/stamp-otssends to three default calendars (alice, bob, finney) and needs two to answer. - SHA-256 is collision-resistant. Practical collisions break
iduniqueness. - 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:
- Reconstruct the canonical message from envelope fields before trusting
the declared
id. - Verify
sig.valueunder BIP-322 before trusting envelope contents. - Verify the OTS anchor against a real Bitcoin block header when
ots.status === "confirmed"and the caller attaches legal/economic weight. - Re-resolve any stake claim. Never trust the declared
sats_bonded/days_unspent— fetch the attestation, and accept it only if its address issigner.address(checkStakein@orangecheck/stamp-core). - Reject unknown
envelope.vvalues. Preserve unknown optional fields on relay. - Produce byte-identical canonical messages for identical inputs across implementations.
- 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 bysig.value.stake,otsandcontent.refare outside it:otsis checked against Bitcoin, andstakeagainst orangecheck andsigner.address. - Signature replay across canonical messages — mitigated.
oc-stamp:v1domain 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_ANCHORerror. content.refreturns 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.
| Attack | Mitigation |
|---|---|
| Aggregator refuses service | Submit directly to calendars |
| Aggregator drops submission | Re-submit; OTS is idempotent |
| Aggregator delays pending proof | Re-query calendar directly |
| Aggregator returns fraudulent pending proof | Caught at upgrade; the "pending" proof cannot chain to any Bitcoin block |
| Aggregator modifies a signed field | Invalidates id, fails signature verification on relay |
Aggregator strips or swaps stake | Not signed; the stake check accepts only the signer's own attestation |
Dependency postureLink to this section
Narrow surface:
| Package | Purpose |
|---|---|
@ | SHA-256 |
@ | secp256k1 Schnorr / ECDSA |
@ | OTS proof parsing |
@ | BIP-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.