Transactions

From claude-dev-suite/claude-dev-suite · View interactive version

Transactions is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. Bitcoin transaction structure: inputs, outputs, witness, version, locktime, serialization (legacy + segwit + wtxid), sighash modes, malleability, TRUC v3, ephemeral anchors. Quick-ref docs cover sighash combinatorics, serialization wire format, malleability classes, RBF/CPFP rules. USE WHEN: buildin

How to use this skill

Skill file

Bitcoin Transactions

Quick refs: sighash.md, serialization.md, malleability.md, rbf-cpfp.md, v3-truc.md

Anatomy

version (4 bytes)
[marker (0x00) flag (0x01)]    ← only if SegWit, signals witness presence
vin count (varint)
vin[]:
  prevout: { txid (32), vout (4) }
  scriptSig (varint-prefixed)   ← legacy unlocking script
  sequence (4 bytes)
vout count (varint)
vout[]:
  value (8 bytes, sats)
  scriptPubKey (varint-prefixed)
[witness[]]                     ← if marker/flag present, one stack per input
locktime (4 bytes)

Version: 1, 2 (BIP68 relative locktimes require v≥2), 3 (TRUC, BIP431).

txid vs wtxid

reference.

uses (BIP141 witness merkle root).

Inputs & outputs

via scriptSig + (for SegWit) witness stack. Value = whatever the

prevout had — never serialized in the spending tx (must be looked up).

Sighash flags

See sighash.md for full combinatorics. Summary:

| Flag | Signs |

|------|-------|

| ALL (0x01) | All inputs, all outputs |

| NONE (0x02) | All inputs, no outputs (anyone can change outputs) |

| SINGLE (0x03) | All inputs, only output at same index |

| \| ANYONECANPAY (0x80) | Only this input's prevout (others can be added) |

Taproot adds SIGHASH_DEFAULT (0x00 = ALL with new digest) and changes

serialization (BIP341).

TRUC v3 (BIP431)

descendant, ancestor must also be v3.

the sibling's bandwidth.

parent + child paying full package fee.

Ephemeral anchors

"Ephemeral anchor" names two separate policies shipped in two different

releases; see package-relay/SKILL.md.

2-byte witness v1 program (not Taproot, whose programs are 32 bytes).

Standard to spend since Bitcoin Core 28.0 (October 2024); specified by

BIP433, Status Draft as of September 2026. Default dust limit 240 sat.

output, any script type and down to value=0, provided the creating tx

pays zero fee.

unconfirmed outputs, i.e. in the same package (mempool rule).

will not relay; BIP433 presents P2A as the compact replacement for

sh(OP_TRUE).

outputs with a single keyless shared_anchor P2A output under

zero_fee_commitments: 240 sat in the normal case, dropping below

240 sat (down to 0) only when the commitment has less than that left

over, in which case the commitment pays zero fee. See BOLT-3

03-transactions.md, "shared_anchor Output (zero_fee_commitments)".

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.