Skip to content

0xunLin/Coin-Smith

Repository files navigation

Coin Smith: The Daily Driver Manual

A Practical Guide to Advanced Bitcoin Transactions

Welcome to Coin Smith. While originally built as an advanced Partially Signed Bitcoin Transaction (PSBT) engine, this tool is designed to be your daily driver for constructing, analyzing, and broadcasting secure Bitcoin transactions.

This manual will walk you through how to use Coin Smith in your day-to-day crypto life, from basic payments to advanced fee optimization and air-gapped security.


1. Installation & Setup

Before you begin, ensure you have Node.js (v14 or higher) installed on your machine.

Step-by-Step Setup:

  1. Clone the repository to your local machine:
    git clone <repository_url>
    cd coin-smith
  2. Install the dependencies:
    npm install
  3. Start the local Web Interface:
    ./web.sh
    # Or simply: node server.js
  4. Open your browser and navigate to http://localhost:3000.

2. Daily Operations & Workflows

Scenario A: Making a Standard Secure Payment

You need to pay a vendor or send funds to a cold storage address, but you want to ensure the fee is optimal and your change is securely routed.

  1. Load your UTXO Data: In a real-world scenario, you would export your available UTXOs from your watch-only wallet (like Sparrow or Electrum) as a JSON object matching the Coin Smith fixture format.
  2. Import to Coin Smith: Drag and drop this JSON file into the dashed Dropzone at the top of the interface, or click it to browse for your file.
  3. Review the Build: The system will automatically select the best coins using Greedy, Branch and Bound, or Knapsack algorithms.
  4. Inspect the Flow: Scroll down to the visual Flow Container. Verify your inputs on the left. Verify that the correct amount is matching your target PAYMENT address on the right, and that the remaining balance is safely routed to your CHANGE address.
  5. Sign & Broadcast:
    • Paste your Private Key (WIF format) into the secure signing box.
    • Click "Sign TX".
    • Click "Broadcast to Mempool.space" to publish your transaction directly to the global network.

Scenario B: Rescuing a Stuck Transaction (CPFP)

You sent a transaction yesterday with a low fee (e.g., 2 sat/vB) and it has been stuck in the mempool due to a sudden spike in network congestion.

  1. Configure a CPFP Fixture: Create a JSON input that includes your stuck transaction's details (its TxID as an input, and the stuck_tx_vbytes and stuck_tx_fee metadata).
  2. Activate Accelerator Mode: At the top of the Coin Smith UI, toggle the mode from standard mapping to Child-Pays-For-Parent (CPFP) Accelerator.
  3. Analyze the Package Rate: Load your fixture. Coin Smith will calculate the exact mathematical fee required on your new transaction to compensate for the stuck parent.
  4. Execute: The builder will intentionally overpay the fee on the new transaction. By signing and broadcasting this child block, miners will be mathematically incentivized to mine both your stuck transaction and your new transaction together.

Scenario C: Trimming "Dust" for Fee Efficiency

Your wallet has fragmented into tiny UTXOs. When making a payment, you notice the network fee is consuming an unreasonable percentage of your transaction.

  1. Hover the Byte Breakdown: While building your transaction, hover over the Interactive Byte Breakdown bar.
  2. Identify The Leak: Look at the neon yellow "Outputs" section. You might see a tiny Change output that is actually costing you more in satoshis to create (due to added byte size) than it holds in value.
  3. Activate Dust Donation: Toggle the "Automatically donate dust change to miners" checkbox in the Fee overview card.
  4. Observe Optimization: Coin Smith will immediately rebuild the transaction, dropping that wasteful change output, thereby shrinking the overall transaction size and lowering your required network fee.

3. Advanced Privacy & Security Hygiene

As a daily driver, Coin Smith is built to protect you before you ever make a mistake on-chain.

The Privacy Meter

Before you sign any transaction, always check the Privacy Meter located in the Sign & Broadcast section.

  • It actively scans your inputs against your outputs.
  • If it detects Address Reuse (using the same receiving address multiple times, severely damaging your anonymity set), the score drops.
  • If it detects Change Linkage (routing your change back to the exact same script signature as your inputs), it will throw a severe warning.

Air-Gapped Signing Workflows

For high-net-worth transactions, Coin Smith is designed to never let your private keys touch an internet-connected device.

  1. Build your transaction on an internet-connected machine.
  2. Transfer the resulting PSBT (Base64 string) to an entirely offline, air-gapped machine running Coin Smith.
  3. Import your WIF key on the offline machine and click "Sign TX".
  4. Click "Show QR". Coin Smith will project the finalized raw Hex transaction as a dense QR code.
  5. Use your internet-connected smartphone or laptop to scan that QR code and broadcast the hex directly to the network.

4. Nerd Mode: Verify, Don't Trust

If you run a full Bitcoin Core node and prefer verifying operations via the CLI:

  1. Open the Sign & Broadcast section.
  2. Click "View Nerd Mode".
  3. Coin Smith will generate the exact, ready-to-paste Bash commands (like bitcoin-cli decodepsbt or testmempoolaccept) relative to the exact transaction state currently living in your browser. Paste these into your node terminal to cross-verify the builder's logic independently.

About

🛠️ Coin Smith: A high-precision Bitcoin UTXO manager & PSBT builder. Optimized for fee efficiency (BnB/Knapsack), privacy analysis, and wallet safety. Supports RBF, Locktime, Taproot, and CPFP. Includes a web visualizer and CLI to justify and verify secure transactions. Bitcoin protocol-first correctness and defensive validation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors