Skip to content
Developer Handbook

Cash Improvement Proposals

CashTokens FT and NFT Ambiguity Fix

On this page

CHIP-2026-06 · Retracted · Tokens

Proposed simplifying conditions around outputs that contain both a fungible amount and an NFT.

Original proposal

Specification

    Title: CHIP-2026-06 CashTokens FT+NFT Ambiguity Fix
    First Submission Date: 2026-06-14
    Owners: bitcoincashautist (ac-A60AB5450353F40E)
    Type: Technical
    Layers: Consensus (token validation)
    Status: RETRACTED
    Last Edit Date: 2026-06-14

RETRACTED 2026-06-16. Turns out the CHIP’s approach is not really free: it would force technical debt to wallet developers, who would now have to worry about this wart when trying to optimize user balances into least number of UTXOs.

See discussion: https://bitcoincashresearch.org/t/retracted-chip-2026-06-cashtokens-ft-nft-ambiguity-fix/1870

Summary

Under the current CashTokens Script introspection API, a UTXO holding both a fungible token (FT) amount and an immutable NFT with a zero-byte commitment is indistinguishable from a UTXO holding only the FT. This proposal adds a consensus rule prohibiting new outputs from carrying that combination. Existing UTXOs already in the ambiguous state remain spendable but must be split into separate FT and NFT outputs when spent. Blockchain scan shows that this exotic combination appeared only a few times and closing the gap is unlikely to cause grief to anyone.

Deployment

Deployment of this specification is proposed for the May 2027 upgrade.

  • Activation is proposed for 1794744000 MTP, (2026-11-15T12:00:00.000Z) on chipnet.
  • Activation is proposed for 1810382400 MTP, (2027-05-15T12:00:00.000Z) on the BCH network (mainnet), testnet3, testnet4, and scalenet.

Motivation

Under the current CashTokens rules, the following two UTXO compositions produce identical results from all three token introspection opcodes:

UTXO composition OP_*TOKENCATEGORY OP_*TOKENCOMMITMENT OP_*TOKENAMOUNT
Pure FT 32-byte category ID empty amount
FT + immutable NFT (0-byte commitment) 32-byte category ID empty amount

No combination of introspection opcodes can tell these apart from within Script. This ambiguity complicates contracts that need to verify whether an NFT is present, and it creates a hard gap in sighash construction that would otherwise be needed by Script-implemented signing schemes (see CHIP-2026-06 OP_SIGHASH).

The ambiguity does not affect wallets or indexers inspecting transactions from outside the VM. It is strictly a Script-level introspection limitation.

A chain scan shows only one experimental contract minting the ambiguous combination, and a handful of P2PKH UTXOs currently carrying the ambiguous combination, so the practical impact of prohibiting new ones is near zero.

Script Introspection Malleability

If transaction includes an OP_CHECKSIG with SIGHASH_ALL signature then it will commit to the exact NFT state and there will be no ambiguity.

But if transaction is made purely of Script automatons using introspection without any signatures, then even if they check every input and output they can not check for the 1 bit: the hasNFT on FT + empty NFT outputs. If the original transaction had the NFT, any 3rd party could remove it. Or, if the original transaction didn't create it on the outputs, but inputs introduced it, any 3rd party could add it to outputs.

Technical Specification

Consensus Rule

A transaction output MUST NOT contain both a non-zero fungible token amount and an immutable NFT whose commitment is zero-length.

If an output's token amount is non-zero, and the output contains an immutable NFT, and that NFT's commitment has length zero, the transaction is invalid.

Scope

The rule applies to new outputs only — it is a validity condition checked during transaction validation. It does not affect the UTXO set directly.

Existing UTXOs that already carry the ambiguous combination:

  • Remain in the UTXO set.
  • Can be spent normally.
  • When spent, the transaction creating the spend MUST NOT produce any output that violates the rule. In practice, the spender must split the FT and the empty NFT into separate outputs.

Unambiguous cases unaffected

The following combinations remain valid and are already unambiguous under the introspection API:

  • Pure FT with no NFT.
  • Pure immutable NFT with zero-byte commitment and no FT amount.
  • Immutable NFT with a non-zero-length commitment (with or without FT).
  • Mutable NFT in any combination (always distinguishable via the capability byte).

Rationale & Alternatives

Change OP_*TOKENCATEGORY to return a capability byte for immutable NFTs

This was considered in the original CashTokens design discussion (cashtokens#29). It was rejected because:

  • It would add 1-2 push bytes to every category comparison in token-aware contracts, since the returned value would be 33 bytes instead of 32.
  • Contracts could no longer directly compare category IDs between two outputs using OP_EQUAL; they would need OP_SPLIT and manual inspection of the final byte.
  • The ambiguity affects only one edge case (FT + zero-byte immutable NFT), which is rare in practice.
  • This change would likely break existing contracts.

Add a new OP_*HASNFT to return the raw bit from UTXO encoding

This would close the gap, but as we will see these combinations are extremely rare and not worth maintaining an opcode and compliciting all contracts just to catch the edge case. Prohibiting the edge case is simpler, and all contracts benefit automatically at 0 extra cost to them.

Disallow zero-length commitments entirely

This would be simpler but overly restrictive. Zero-byte commitments on pure NFT UTXOs (no FT) are unambiguous and useful for NFTs that carry no extra data.

Do nothing

Leaves the introspection gap. Script-based signers and token-aware contracts cannot construct a fully general sighash or verify NFT presence in the ambiguous case. The cost of the fix is small and the ambiguity is a known wart in the introspection API.

Contract authors aware of the wart have to continue to work around it (by forcing a split just so they can verify it with the API) but in some cases it is impossible to work around it and prevent empty NFT leaks (NFT minting input).

Costs, Risks, and Security Considerations

Backward compatibility

The rule is forward-looking: it applies only to new outputs. No existing UTXO is made unspendable. The handful of existing ambiguous UTXOs can be spent by splitting the FT and NFT into separate outputs.

No new attack surface

The rule removes a state, it does not add one. It eliminates the ambiguity that could otherwise be exploited by a counterparty who constructs an FT UTXO with a hidden empty NFT to confuse a contract.

Consensus determinism

The check is a simple boolean condition evaluated during output validation. It depends only on the output's token data, which is already fully validated by existing consensus code. No new hashing, signing, or platform-dependent behavior is introduced.

Breaking Existing Contracts

Since contracts can't tell the difference it is impossible that prohibiting this combination would break the contract by making it unspendable. The spender could simply burn or extract the empty NFT to satisfy the new consensus rule and the contract would be none the wiser.

However, this may break intended behavior of the contract because existing contracts may be prohibiting extraction, leaving burn as the only option. Ironically, the CHIP author's experimental contract will be the most affected by this change:

It mints an empty NFT as the "box" and 50 FTs as "popcorns" inside the box. With this change, the contract would continue to work, but minting transaction would be forced to omit the box and only release the 50 FTs. Since this was a toy contract which hasn't been used for more than 6 months, and the tokens never had a market value, we feel that removing the Script API wart is worth the loss. Holders of existing "popcorn" NFTs will still have their NFTs, but minting new NFTs will become impossible.

Burning Existing NFTs

The rule change won't cause a burn. Transactions trying to create the combination would fail, and users would have to construct a splitting transaction which would preserve both the FT and the empty NFT.

Current State Analysis

There's only a few transactions and UTXOs with the combination, most of these minted by the "popcorn stand" experimental dApp. They're all held in P2PKH UTXOs so there will be no problems with splitting them.

Table: FT + empty NFT on-chain analysis

first_seen last_seen category fingerprint fingerprint_p2sh sum(opened_sats) sum(closed_sats) sum(opened_count) sum(closed_count)
2023-05-15 2023-05-15 e34790440c28c7b6521855cc846610c3883a8a136d3dbd1e3a297abd1c6b3988 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 800 0 1 0
2023-07-06 2023-07-06 39253b923cbeee7e448bc3a8b1b8718b54d385cf67230cf79e52220fc25273b4 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 800 0 1 0
2023-07-06 2023-07-06 3a4f41efbfc8745835ee02547fc1057243367e77161837b0778ded4b92ebd499 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 800 0 1 0
2023-07-06 2023-07-06 8ff9fcfb641922aff6dd8e76c4b34d90db9667c772b4fef7b604db1af38db762 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 1600 800 2 1
2023-12-03 2024-02-08 02a690fadd8e3ff5539726c6eca6c2b8039bce945634d78ac46b1db26a8a0eaf aff85dae866c7ef5d49f709f4afb3e10d2392d45f21cf5923c582d9fafc712e4 1a1ee206446c444f663bb7226de0f688751fcdaedccd5b5bbeb566f312cfb4c5 800 800 1 1
2024-03-31 2024-03-31 85a8cb26e469b79574941afcba57ecb7f8269859d4f497728301d776f91497ec 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 1000 0 1 0
2024-04-02 2024-04-02 1df39ed49bc7d4608ac0ab9994b0535c0b32041253ad3bbd2a48ec4d5d713207 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 1000 0 1 0
2024-04-04 2024-04-05 50b1d358fb8cc32545b826aeae6f7f2366ad4906c31285712bece240bb4dd7c9 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 2000 0 2 0
2024-04-18 2024-04-18 62c64414e4d8007d756c179932d5d2097481ffb1aa021c42f7e050fb05eafcb1 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 2000 0 2 0
2024-05-07 2024-05-07 f5a688bd5873db88325ac4cd305a92cc20aae722b0471aae828e739e9db17740 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 800 0 1 0
2024-06-12 2024-06-12 2c524868239e8a7412e877b4b5cb9f7ca6f7e686db08e9126e3a6d5496fc896c 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 800 0 1 0
2024-11-24 2024-11-24 599e920e184a913d35053c172514466d4e8f52883e5bd10e2b3ea3c00562c410 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 1600 800 2 1
2023-09-07 2025-02-18 02a690fadd8e3ff5539726c6eca6c2b8039bce945634d78ac46b1db26a8a0eaf aff85dae866c7ef5d49f709f4afb3e10d2392d45f21cf5923c582d9fafc712e4 2000 0 2 0
2023-09-07 2025-02-18 02a690fadd8e3ff5539726c6eca6c2b8039bce945634d78ac46b1db26a8a0eaf aff85dae866c7ef5d49f709f4afb3e10d2392d45f21cf5923c582d9fafc712e4 8b644bdc5cc9760257526a184088b53a052e75ca1ee01ef8ee6eff3e069ec377 3000 3000 3 3
2025-02-20 2025-02-20 40b0c45c8ea6682dcb20d88c796448d470a62680314a85a3123c948ffe5c3698 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 800 0 1 0
2025-02-03 2025-03-30 4c51e0a663f400c978d888364dc7ce8169a5caed97c023b6a4f8e49365bf34fd 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 1600 1600 2 2
2024-04-06 2025-05-16 cdffc3c4386d59717aabda86f97d11fc35ca61ffc6612f480bc0963187e9184b 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 43600 8600 44 9
2025-08-04 2025-08-04 d274768ce0c60877417d0410afbbab8dee927c85511ea5414b83a199c1427e0b 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 800 0 1 0
2023-09-06 2025-11-23 02a690fadd8e3ff5539726c6eca6c2b8039bce945634d78ac46b1db26a8a0eaf 516879464c7ddd10dc73a3ecb9708b0fd24343287a16387dd6b961363b87714b 107000 64200 133 80

Primary Stakeholders

  • Node developers (BCHN, BCHD, Knuth, etc.): add the output validation check.
  • Wallet & library developers: ensure wallet-generated transactions never produce the prohibited combination.
  • Contract / dApp developers: can rely on the introspection API being unambiguous for all future UTXOs.

MIT No Attribution.

MIT No Attribution license text