▶ Hackathon project
§ Project file

DiffHedge

The permanent record for this hackathon project: write-up, links, team, tags, and prizes.
Submitted Bitcoin++ Sovereignty Edition
Trust-minimized binary options on Bitcoin Layer 1. Hedge network difficulty directly using Taproot and MAST. No bridges, no tokens, just native Script.
The write-up

💡 Inspiration Bitcoin DeFi often relies on sBTC or centralized bridges. We wanted to prove that native hedging is possible directly on Layer 1. By leveraging Taproot (BIP341), we built a protocol that allows users to hedge against network difficulty volatility without trusting a custodian. 🛠️ What it does HashHedge is a trust-minimized binary options protocol. Users request a contract to bet on Bitcoin network metrics. Our backend generates a P2TR (Taproot) address where the "House" matches the user's deposit 1:1. Settlement is non-custodial: If the user wins, the logic tree allows them to claim funds with just an Oracle's signature. The backend cannot withhold user winnings. ⚙️ How we built it We used Python and FastAPI to interact with Bitcoin Signet. Instead of standard multisig, we implemented MAST (Merkle Abstract Syntax Trees). We encoded three spending paths—[User Win, House Win, Refund]—into a single Merkle Root. For settlement, we use PSBTs (Partially Signed Bitcoin Transactions). If a user wins, we send a transaction signed by the Oracle to the client, allowing the user to add their signature and broadcast it, keeping their private key secure. 🚧 Challenges Debugging raw Bitcoin Script is unforgiving. Our biggest hurdle was correctly implementing BIP341 Key Tweaking—specifically handling the control blocks and parity bits required for valid Schnorr signatures. A single byte error would invalidate the entire Taproot witness. 🏆 Accomplishments True L1 Native: No sidechains, no tokens. Just pure Bitcoin Script. MAST Implementation: We successfully executed Taproot spends that reveal only the used script branch, saving fees and preserving privacy. 🚀 What's next We plan to replace our simulated oracle with Discreet Log Contracts (DLCs) standards and enable direct peer-to-peer (P2P) betting without a "House" intermediary.

Try it out