CIP-33 (File Storage in P2WSH Outputs) was a Counterparty Improvement Proposal by JP Janssen, created on 19 December 2023. It described putting file bytes into the 32-byte witness-program fields of Bitcoin P2WSH-shaped transaction outputs while using a Counterparty asset issuance or broadcast to identify the file. The proposal was an Informational Draft, not a consensus change to Bitcoin or an adopted Counterparty Core rule. Its design became the direct documentary antecedent of Bitcoin Stamps' OLGA encoding in February 2024. Original 19 December 2023 proposal — direct source · 22 February 2024 OLGA specification
The December 2023 design
The first surviving version was committed by JP Janssen on 19 December 2023 with the title File Storage in P2WSH Outputs. Its motivation was to retain file bytes in Bitcoin outputs while avoiding the Base64 and bare-multisig overhead of the original Bitcoin Stamps encoding. The author grouped the earlier approaches as “Stamps (CIP25, CIP26)”, but the two documents had different purposes: CIP-25 concerned enhanced asset information and link formats, while CIP-26 proposed a generic stamp: file convention in April 2023. The grouping is the author's description, not proof that CIP-25 standardized Stamp payloads. Original commit
The proposed procedure was:
- Prepend a two-byte file-length integer to the file bytes.
- Divide the resulting byte stream into 32-byte chunks and pad the last chunk.
- Place those chunks into P2WSH-shaped Bitcoin output scripts.
- Include a Counterparty issuance or broadcast message in the same Bitcoin transaction, identifying the file.
The name P2WSH describes the standard output-script shape (OP_0 plus a 32-byte program). It does not mean that the stored file is a witness script revealed by an input. The protocol repurposes program bytes in outputs. For ordinary P2WSH, those bytes represent a witness-script hash; using arbitrary file chunks instead makes the outputs practically difficult to spend without a matching script. This distinction matters to both storage costs and claims about permanence. CIP-33 specification · Segregated Witness
CIP-33 called for a case-insensitive FILE: prefix. For issuance, an asset description beginning with FILE: was followed by a filename. For broadcasts, it proposed filename conventions using double underscores to associate one asset or triple underscores to associate a parent and its subassets. A broadcast by the current issuer was designated official; another sender's broadcast was unofficial under the proposed convention. These are application interpretation rules, not Bitcoin Script rules. Original draft
The draft links a purported mainnet example, transaction 549a5cc4bc189c800f0f9ea01068e8a7fd987c7dadb40c0b6a224d489ed070cc, and a testnet example. It also links the author's Electrum-based issuance and broadcast tools. Those are contemporary first-party implementation references. BOMB has not independently parsed the example transactions to establish their exact outputs, successful file reconstruction or acceptance by Counterparty Core. Original demonstration references
The browser implementation before the written proposal
The date 19 December 2023 identifies the written CIP's creation, not the first surviving source for its encoder. On 15 December 2023 at 15:27 UTC, the Jpja/Electrum-Counterparty repository committed two browser forms, cip33_issuance.html and cip33_broadcast.html, alongside js/xcp/cip33.js and additions to its transaction decoder. The commit describes these changes as “CIP33”. It provides version-pinned first-party evidence that the proposed builder and decoder code existed four days before the proposal's stated creation date. Source publication does not establish an earlier mainnet deployment or independent acceptance by Counterparty Core. 15 December source commit — contemporary direct record
The implementation also resolves some ambiguities in the later draft, but only for this builder. Its file_to_addresses() encodes the byte length as four hexadecimal digits (most-significant byte first), prepends those two bytes, splits the result into 32-byte chunks, and pads the last one. The companion function reads that prefix in the same order; both browser forms check that the encoded addresses reconstruct the uploaded file. Each form refuses input files larger than 6,304 bytes, whereas CIP-33's later text gives 6,334 bytes under its own 198-chunk assumption. A 6,304-byte file plus the two-byte prefix still takes 198 chunks, with 30 padding bytes. The narrower form limit cannot be promoted into a Bitcoin consensus limit, a universal relay policy, or the maximum accepted by other decoders. Original chunk encoder · Original issuance form · Original broadcast form
The two forms even assemble their outputs differently. The broadcast form places its Counterparty OP_RETURN before the file chunks; the issuance form puts the first file chunk before the OP_RETURN, followed by the remaining chunks. The bundled decoder collects P2WSH-shaped outputs in their transaction order and decodes the two-byte prefix, so its extraction path does not require OP_RETURN to be first. CIP-33's later prose instead says to add the chunks after the Counterparty message. This is a documented difference between one contemporary implementation and the written description, not proof that either ordering appeared in a mined transaction or that unrelated decoders accepted both. Broadcast ordering · Issuance ordering · Decoder
From CIP-33 to OLGA
On 21–22 February 2024, the Bitcoin Stamps repository assembled Octet Linked Graphics & Artifacts (OLGA) using this method. The OLGA document explicitly credits JP Janssen's File Storage in P2WSH Outputs. Its substantive text repeats CIP-33's chunking design and cost-comparison examples. OLGA document history · Early 22 February version
The adaptations matter. OLGA used STAMP: instead of FILE:, required a numeric Counterparty asset rather than a named or named-subasset asset, and specified a Counterparty issuance relationship rather than the broader CIP-33 broadcast-filename conventions. Its later text allowed the Counterparty message to use OP_RETURN or multisig encoding and reserved the characters following STAMP: for future use. These are restrictions of Stamp recognition, not a change to the 32-byte Bitcoin output carrier. OLGA specification at activation revision
One 22 February change by Reinamora shifted the proposed Classic Stamp OLGA activation boundary from block 832,000 to 833,000. The present Stamp indexer additionally assigns later, distinct OLGA cutovers to SRC-20 and SRC-101. This is evidence of per-protocol acceptance rules, not a single network-wide P2WSH activation. Activation-height edit · Indexer-maintained heights
Two limits in the published text that need correction
Both CIP-33 and its OLGA adaptation say that a standard Bitcoin node accepts a maximum of 200 outputs per transaction, leaving 198 for file chunks after an OP_RETURN and change. Their arithmetic, 198 × 32 − 2 = 6,334 bytes, is correct given that 200-output assumption. However, Bitcoin Core v27.0's IsStandardTx() checks transaction weight, each output's script type and dust, and the number of null-data outputs; it does not impose a blanket maximum of 200 outputs. Its policy constant is MAX_STANDARD_TX_WEIGHT = 400000. The documents therefore do not establish a universal 200-output Bitcoin relay limit. A wallet, builder or service may have its own limit; BOMB has not identified the origin of the number 200. Bitcoin Core v27.0 standardness implementation — direct source · Policy constants · Transaction standardness
There is also a literal arithmetic mistake: the drafts print 256^2 − 2 = 65,536, although the left-hand expression is 65,534. If the two-byte file length is an unsigned integer, its largest representable value is 65,535. These facts should not be conflated into a new protocol maximum: the original drafts do not fully specify their length-field byte order and enforcement, and BOMB has not tested the effective limit of a version-pinned decoder. Original limitations section
The same first-party comparison reports a 2,853-byte Classic Stamp and a 2,474-byte CIP-33/OLGA file. The claimed fee and dust savings describe different example files, not a controlled same-file test. And the proposed long-lived storage depends on the data-carrying outputs remaining unspent and represented in validating nodes' UTXO sets. That is a trade-off rather than an extra Bitcoin consensus permanence guarantee. Cost examples · OP RETURN
Status and preservation
CIP-33 retained Draft status in its archived text. In May 2024, the CIPs repository moved the old proposal files out of its then-current tree during a forum reorganization. Its present home is cip-archive/cip-0033.md. In June 2025, Counterparty's renewed CIP policy explicitly described its pre-2025 CIPs as historical and abandoned in their original form, potentially eligible for resubmission. That later archival judgement does not undo the proposal's documented influence on OLGA. May 2024 repository transition · 2025-onward CIP policy · Archived proposal
The surviving record establishes a proposed encoding, a contemporary author-provided tool and demonstration references, and a later derivative specification. It does not establish formal adoption by Counterparty Core, a complete deployed-file census, or that all CIP-33 files qualify as numbered Bitcoin Stamps.
Related pages
- Counterparty
- CIP-26
- Bitcoin Stamps
- OP RETURN
- Segregated Witness
- Transaction standardness
- Metaprotocols
Open research
Independently parse CIP-33's cited mainnet and testnet transactions, including ordered output scripts, length prefix, Counterparty message and reconstructed file.
Identify which wallet, service or earlier specification originated the 200-output claim; compare it with version-pinned Bitcoin Core policy and actual standard relay behavior.
Compare the documented 15 December 2023 browser builder (big-endian length, 6,304-byte form limit, differing output order) against version-pinned production CIP-33 and OLGA decoders, including bounds, padding, and whether both orderings are accepted.