bitcoin-transactions
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: building/decoding transactions, choosing sighash flags, understanding txid vs wtxid, fee bumping logic.
What this skill does
# Bitcoin Transactions
> **Quick refs**: [sighash.md](quick-ref/sighash.md), [serialization.md](quick-ref/serialization.md), [malleability.md](quick-ref/malleability.md), [rbf-cpfp.md](quick-ref/rbf-cpfp.md), [v3-truc.md](quick-ref/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
- `txid = SHA256d(tx without witness data)` — what spends and merkle root
reference.
- `wtxid = SHA256d(tx with witness)` — what coinbase witness commitment
uses (BIP141 witness merkle root).
- For legacy non-segwit txs, `txid == wtxid`.
## Inputs & outputs
- **Input** spends a previous output (`txid:vout`) and proves authorization
via scriptSig + (for SegWit) witness stack. Value = whatever the
prevout had — never serialized in the spending tx (must be looked up).
- **Output** locks N sats to a `scriptPubKey`. Address formats:
- P2PKH (`1...`) — `OP_DUP OP_HASH160 <20> OP_EQUALVERIFY OP_CHECKSIG`
- P2SH (`3...`) — `OP_HASH160 <20> OP_EQUAL`
- P2WPKH (`bc1q...`) — `OP_0 <20>` (Bech32)
- P2WSH (`bc1q...`) — `OP_0 <32>` (Bech32)
- P2TR (`bc1p...`) — `OP_1 <32>` (Bech32m)
## Sighash flags
See [sighash.md](quick-ref/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)
- Version=3 marks the tx as TRUC.
- Constraints: `vsize ≤ 10000 vB`, ≤1 unconfirmed ancestor, ≤1 unconfirmed
descendant, ancestor must also be v3.
- Sibling eviction: a v3 child can replace a sibling without paying for
the sibling's bandwidth.
- Designed for Lightning anchor / commitment fee bumping: enables 0-fee
parent + child paying full package fee.
## Ephemeral anchors
- Anchor with `value=0` and trivially-spendable script (e.g., `OP_TRUE`).
- Must be spent in the same package as its parent (mempool rule).
- Combined with TRUC v3, replaces existing anchor outputs (BOLT-3) with
no-cost variant.
## See also
- [scripts/SKILL.md](../scripts/SKILL.md) — opcodes, output type construction
- [taproot/SKILL.md](../taproot/SKILL.md) — Taproot witness, SIGHASH_DEFAULT
- [psbt/SKILL.md](../psbt/SKILL.md) — partially-signed tx workflow
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.