Build raw Bitcoin transactions from scratch using a visual, interactive tool.
The rawBit Study Cohort is a 10-week hands-on program where participants build raw Bitcoin transactions from scratch using rawBit — an open-source visual Bitcoin transaction builder and Script debugger. Participants connect inputs, keys, and scripts on a visual canvas to construct transactions at the byte level, progressing from legacy P2PKH all the way to Taproot.
This cohort is the natural next step after Bitcoin Dojo — where you learned the cryptographic primitives, here you apply them to build real transactions.
rawBit is created by @rawBit_io and ships with 12 built-in interactive lessons. Code Orange runs a structured study cohort around these lessons with weekly group calls, peer accountability, and mentor support.
- Completion of Bitcoin Dojo or equivalent knowledge of:
- Elliptic curve cryptography and ECDSA
- Bitcoin address formats (P2PKH, P2SH, P2WPKH)
- Basic transaction structure (inputs, outputs, scripts)
- OR: Strong self-taught understanding of Bitcoin transaction fundamentals
- A laptop with a modern web browser (rawBit runs in-browser)
| Component | Details |
|---|---|
| Duration | 10 weeks |
| Time commitment | 4-6 hours per week |
| Weekly calls | Via Discord (time TBD per cohort) |
| Tool | rawBit visual transaction builder |
| Level | Intermediate (post-Bitcoin Dojo) |
- Each week: 1-2 rawBit lessons assigned + supplementary readings
- Self-study: Work through the interactive lessons in rawBit — drag, connect, build, inspect
- Weekly call: Group discussion and live debugging of transaction construction
- Challenge exercises: Build increasingly complex transactions without the guided mode
- Final project: Construct a complex multi-condition Taproot transaction from scratch
rawBit Lessons: Lesson 1 (P2PK), Lesson 2 (P2PKH)
Topics:
- rawBit interface: canvas, nodes, connections, inspector
- Pay-to-Public-Key (P2PK): the simplest transaction type
- Pay-to-Public-Key-Hash (P2PKH): why hashing the public key matters
- Building a complete transaction: input → scriptSig → output → scriptPubKey
- Inspecting the raw hex output byte by byte
Exercises:
- Build a P2PK transaction in rawBit — send coins to a public key and spend them
- Build a P2PKH transaction — compare the script structure to P2PK
- Export the raw hex and decode it manually, labelling every field
Discussion:
- Why did Bitcoin move from P2PK to P2PKH? What's the security improvement?
rawBit Lessons: Lesson 3 (Multisig), Lesson 4 (P2SH fundamentals)
Topics:
- OP_CHECKMULTISIG: how multi-signature verification works in Script
- The off-by-one bug and OP_0 workaround
- 2-of-3 multisig: building and spending
- Pay-to-Script-Hash (P2SH): hiding complex scripts behind a hash
- Redeem scripts and their role in P2SH
Exercises:
- Build a 2-of-3 bare multisig transaction in rawBit
- Wrap the same multisig in P2SH — compare the output scripts
- Spend from the P2SH output by providing the redeem script and signatures
rawBit Lessons: Lesson 5 (nLockTime/nSequence), Lesson 6 (OP_CHECKLOCKTIMEVERIFY)
Topics:
- Absolute timelocks: nLockTime (transaction-level)
- OP_CHECKLOCKTIMEVERIFY (CLTV): script-level absolute timelock
- Relative timelocks: nSequence and OP_CHECKSEQUENCEVERIFY (CSV)
- Use cases: payment channels, inheritance, escrow
Exercises:
- Build a transaction with an nLockTime set to a future block height
- Build a CLTV-locked output that can only be spent after block N
- Build a CSV-locked output with a relative timelock of 144 blocks (~1 day)
- Combine timelocks with multisig: "Alice can spend immediately with 2-of-3, OR Bob can spend alone after 1000 blocks"
rawBit Lesson: Lesson 7 (OP_RETURN anchors)
Topics:
- OP_RETURN: provably unspendable outputs
- Embedding data in the Bitcoin blockchain
- Size limits and relay policies
- Use cases: timestamping, commitments, coloured coins history
- Ethical and practical considerations of blockchain data
Exercises:
- Build a transaction with an OP_RETURN output containing a message
- Build a commitment scheme: hash a document, embed the hash in OP_RETURN
- Explore a real mainnet transaction with OP_RETURN data
rawBit Lesson: Lesson 8 (Transaction malleability), Lesson 9 (Payment channels)
Topics:
- Transaction malleability: how it works, why it's dangerous
- How scriptSig manipulation changes the txid without invalidating the transaction
- Payment channels: the foundational concept behind Lightning
- Building a simple unidirectional payment channel
- Why malleability breaks payment channels (motivating SegWit)
Exercises:
- Demonstrate transaction malleability: modify a scriptSig encoding and show the txid changes
- Build a simple payment channel: funding tx + commitment txs + settlement tx
- Show how malleability would break the commitment transaction chain
rawBit Lessons: Lesson 10 (P2WPKH)
Topics:
- Segregated Witness: moving the witness outside the txid calculation
- P2WPKH (Pay-to-Witness-Public-Key-Hash): native SegWit
- Witness field structure
- Weight units vs virtual bytes
- The witness discount: why witness data is cheaper
Exercises:
- Build a P2WPKH transaction in rawBit — compare structure to P2PKH
- Calculate the weight and vbytes of your SegWit transaction
- Build the same transaction as legacy P2PKH — compare sizes and fees
- Verify that the witness data is excluded from the txid calculation
rawBit Lessons: Lesson 11 (P2WSH, nested SegWit)
Topics:
- P2WSH (Pay-to-Witness-Script-Hash): SegWit version of P2SH
- Witness scripts vs redeem scripts
- Nested SegWit (P2SH-P2WPKH): backward compatibility
- When to use P2WPKH vs P2WSH vs nested SegWit
Exercises:
- Build a P2WSH 2-of-3 multisig in rawBit
- Build the same multisig as P2SH — compare witness data vs scriptSig
- Build a nested SegWit (P2SH-P2WPKH) transaction
rawBit Lessons: Lesson 12 (Taproot)
Topics:
- Schnorr signatures (BIP340): linearity and key aggregation
- Taproot (BIP341): key-path vs script-path spending
- The Taproot tweak: how a public key commits to a script tree
- P2TR (Pay-to-Taproot) output structure
- Why key-path spends look identical to regular payments (privacy)
Exercises:
- Build a Taproot (P2TR) key-path spend in rawBit
- Build a Taproot output with a script tree
- Spend via the script-path — provide the script, control block, and Merkle proof
- Compare the on-chain footprint of key-path vs script-path
Topics:
- MuSig2: interactive multi-signature with a single public key
- Taproot script trees: building complex spending conditions
- MAST (Merkelized Abstract Syntax Tree) via Taproot
- Combining Taproot with timelocks for complex contracts
- Tapscript (BIP342): new opcodes for Taproot
Exercises:
- Design a Taproot output with 3 spending conditions in the script tree
- Build an escrow contract: "Alice+Bob key-path, OR Alice after 1000 blocks, OR Bob+mediator"
- Calculate the Merkle root of a script tree with 4 leaves
Final Project: Build a complex, real-world Bitcoin transaction entirely from scratch in rawBit. Choose from:
- Inheritance Vault: Taproot output where spouse can spend with 2-of-3 multisig immediately, OR a single heir key after 52,560 blocks (~1 year)
- Atomic Swap: Construct both sides of a cross-chain atomic swap using HTLCs (Hash Time-Locked Contracts)
- Lightning-style Channel: Full funding → commitment → revocation → settlement flow
- Custom Design: Propose your own complex transaction design
Presentation: Each participant presents their final project:
- What does the transaction do and why is it useful?
- Walk through the script tree / spending conditions
- What did building it teach you about Bitcoin?
- What will you build or contribute to next?
Graduates are ready to:
- Start contributing to Bitcoin transaction-related projects (BDK, rust-bitcoin, Bitcoin Core wallet)
- Build wallet software that constructs transactions correctly
- Review PRs involving transaction format changes
- Teach others using rawBit as a visual aid
- Continue to the Decoding Bitcoin cohort for Bitcoin Core contribution
- Ensure all participants have rawBit running in their browser
- Confirm participants have completed Bitcoin Dojo or equivalent
- Set up Discord channel with weekly threads
- Coordinate with @rawBit_io for any tool updates or support
- Post weekly lesson assignments every Sunday
- Host weekly calls — screen-share rawBit for live transaction building
- Encourage participants to export and share their transaction hex
- Pair struggling participants with faster learners
- Host graduation presentations
- Connect graduates to relevant Good First Issues (especially BDK, rust-bitcoin transaction modules)
- Track graduate outcomes in PR Dashboard
- rawBit tool: rawBit.io — Visual Bitcoin TX builder & Script debugger
- Upstream textbook: Programming Bitcoin by Jimmy Song
- Partner: Code Orange Dev School in collaboration with rawBit
CC0 1.0 Universal. Public domain. Fork it, translate it, teach with it.