Transaction Simulator

Interactive Bitcoin UTXO transaction builder and fee calculator

How to Build a Bitcoin Transaction:

  1. Select Inputs: Choose UTXOs (previous transaction outputs) you own
  2. Create Transaction: Click "Create Transaction" to start building
  3. Add Outputs: Specify recipients and amounts they'll receive
  4. Calculate Fee: Set fee rate (sats/byte) and calculate total fee
  5. Verify: Check transaction validity and sender signature
  6. Broadcast: Send to network (mempool)

💰 Available UTXOs (Unspent Transaction Outputs)

Select one or more UTXOs to use as transaction inputs

📊 Transaction History (Broadcast Transactions)

🔐 Understanding Bitcoin Transactions

Bitcoin transactions use the UTXO (Unspent Transaction Output) model. Unlike traditional banking where you have an account balance, in Bitcoin you own a collection of unspent transaction outputs from previous transactions. To send bitcoin, you consume these outputs as inputs to a new transaction and create new outputs for recipients.

📤 Transaction Input

References a previous transaction output (UTXO). You prove ownership by signing with your private key. The output amount is now consumed.

📥 Transaction Output

Specifies how much bitcoin goes to which address. This becomes a new UTXO that the recipient can spend (if they have the corresponding private key).

💸 Transaction Fee

The difference between total input and total output: Fee = Sum(Inputs) - Sum(Outputs). This goes to miners as a reward for including your transaction in a block.

⛓️ UTXO Model

Every bitcoin transaction creates a directed graph. Your "balance" is the sum of all UTXOs you can spend (those locked to your addresses).

📊 The UTXO Model Explained

Bitcoin uses a "Unspent Transaction Output" model, which is fundamentally different from the account-based model used by banks or Ethereum.

How It Works:

Step 1: Alice sends 1 BTC to Bob. This creates a UTXO at Bob's address (amount: 1 BTC)

Step 2: Bob wants to send 0.7 BTC to Charlie. He must:

  • Use the 1 BTC UTXO as input (spending his entire UTXO)
  • Create 2 outputs:
    • 0.7 BTC to Charlie (new UTXO for Charlie)
    • 0.3 BTC to himself (change, new UTXO for Bob)
  • If mining fee is 0 (for example): 1 = 0.7 + 0.3 ✓

Step 3: Bob now has a new 0.3 BTC UTXO he can spend in future transactions. The original 1 BTC UTXO is now "spent" (consumed).

Key Differences from Accounts:

Feature Account Model (Ethereum) UTXO Model (Bitcoin)
Balance Stored in account state Sum of unspent outputs
Transaction Size Small (just state change) Depends on inputs/outputs
Privacy Account linked to all activity Can use many addresses (privacy)
Change Output ❌ Not needed ✅ Required (if overspending)
Parallelization Hard (state machine) ✅ Easy (independent outputs)

💸 How Bitcoin Fees Work

Bitcoin transaction fees are based on transaction size (in bytes), not the amount being sent.

Fee Calculation Formula:

Fee (BTC) = Transaction Size (bytes) × Fee Rate (sats/byte) / 100,000,000

Example:
• Transaction size: 250 bytes
• Fee rate: 50 sats/byte
• Fee = 250 × 50 / 100,000,000 = 0.00125 BTC ≈ $50 USD (at current prices)

Transaction Size Estimation:
• Input: ~148 bytes each
• Output: ~34 bytes each
• Overhead: ~10 bytes

Mempool and Confirmation Priority:

🔍 Bitcoin Transaction Anatomy

Every Bitcoin transaction has specific structure and components:

Transaction Structure:

Version: 1
Input Count: 2
├─ Input 1
│  ├─ Previous TXID: a1b2c3d4...
│  ├─ Previous Output Index: 0
│  ├─ Script Signature: OP_CHECKSIG...
│  └─ Sequence: 0xffffffff
└─ Input 2
   ├─ Previous TXID: e5f6g7h8...
   ├─ Previous Output Index: 1
   ├─ Script Signature: OP_CHECKSIG...
   └─ Sequence: 0xffffffff

Output Count: 2
├─ Output 1: 0.7 BTC to 1A1z7agoat...
│  └─ Script: OP_DUP OP_HASH160 [...] OP_EQUALVERIFY OP_CHECKSIG
└─ Output 2: 0.29 BTC to 3J98t1Wy2u... (change)
   └─ Script: OP_DUP OP_HASH160 [...] OP_EQUALVERIFY OP_CHECKSIG

Locktime: 0

Digital Signature:

Each input must be signed with the private key of the address that owns the previous output. The signature proves that you authorized the spending of that UTXO without revealing your private key (ECDSA signature).

📱 Real-World Transaction Example

Scenario: You want to send 0.5 BTC to a friend, but you have these UTXOs:

Available UTXOs:
• UTXO 1: 0.3 BTC (from transaction a1b2...)
• UTXO 2: 0.35 BTC (from transaction c3d4...)
• UTXO 3: 0.2 BTC (from transaction e5f6...)

Your Transaction:
• Use UTXO 1 + UTXO 2 as inputs = 0.65 BTC
• Send 0.5 BTC to friend's address
• Calculate fee: 2 inputs × 148 + 2 outputs × 34 = 364 bytes
• At 50 sats/byte: 364 × 50 / 100,000,000 = 0.00182 BTC fee
• Change back to you: 0.65 - 0.5 - 0.00182 = 0.14818 BTC

Result: 2 inputs, 2 outputs, confirmed in ~10 minutes at standard fee rate

Console Commands Available:

Type these commands in the on-screen console: