{"id":28604549,"url":"https://github.com/yllvar/bitvm-prediction","last_synced_at":"2026-04-30T06:39:01.771Z","repository":{"id":298164280,"uuid":"999077919","full_name":"yllvar/BitVM-Prediction","owner":"yllvar","description":"BitVM Prediction Market is a decentralized prediction market built on Bitcoin using Taproot and MAST. It allows two parties to bet on a binary outcome (e.g., \"BTC \u003e $200K by 2026\") with disputes settled trustlessly on Bitcoin.","archived":false,"fork":false,"pushed_at":"2025-06-09T18:10:57.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T19:20:46.869Z","etag":null,"topics":["bitcoin","bitvm","defi","prediction-markets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yllvar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-09T17:49:27.000Z","updated_at":"2025-06-09T18:12:51.000Z","dependencies_parsed_at":"2025-06-09T19:32:47.623Z","dependency_job_id":null,"html_url":"https://github.com/yllvar/BitVM-Prediction","commit_stats":null,"previous_names":["yllvar/bitvm-prediction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yllvar/BitVM-Prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBitVM-Prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBitVM-Prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBitVM-Prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBitVM-Prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yllvar","download_url":"https://codeload.github.com/yllvar/BitVM-Prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2FBitVM-Prediction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259311493,"owners_count":22838726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","bitvm","defi","prediction-markets"],"created_at":"2025-06-11T18:01:01.192Z","updated_at":"2026-04-30T06:39:01.730Z","avatar_url":"https://github.com/yllvar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌟 BitVM Prediction Market\n\n## 🎯 What Is This?\n  \nYou can bet with a friend on whether Bitcoin will hit $200K by 2026. Normally, Bitcoin can't do complex logic like this. But with **BitVM**, we made it possible while keeping Bitcoin’s secure blockchain as the final judge.\n\n## 🔍 Why This Matters\n\nBitcoin is amazing at security and decentralization but not great at running smart contracts. With BitVM, we unlock **Turing-complete logic** — all without changing Bitcoin itself.\n\n### 💡 Use Case\n- Bet on real-world outcomes (e.g., \"BTC \u003e $100K?\")\n- No trust needed — Bitcoin enforces the rules\n- Only disputes go on-chain — saves fees!\n\n## 🛠️ How It Works\n\nHere's the magic:\n\n```mermaid\ngraph TD\n    A[Alice Bets 'YES'] --\u003e|Locks Funds| C(📜 Smart Contract)\n    B[Bob Bets 'NO'] --\u003e|Locks Funds| C\n    O[🔮 CoinGecko Oracle] --\u003e|Reports Price| C\n    C --\u003e|If Both Agree| D[💰 Automatic Settlement]\n    C --\u003e|If Dispute| E[⚖️ Bitcoin Decides]\n```\n\n### ✨ Core Components\n\n- **🔑 Key Management:** Alice, Bob, and an Oracle each have keys.\n- **📜 Contracts:** Built using Taproot + MAST to hide complexity until needed.\n- **💰 Transactions:** PSBT-based funding and settlement.\n- **🔍 Oracle:** Gets Bitcoin price from CoinGecko.\n- **⚖️ Disputes:** If someone cheats, BitVM runs fraud proofs on Bitcoin.\n\n## 📦 Files Overview\n\n```\n/bitvm-prediction-market\n  ├── .env               # Configuration values\n  ├── keys.js            # Generate participant keys\n  ├── oracle.js          # Fetch BTC price\n  ├── contract.js        # Build BitVM scripts \u0026 Taproot address\n  ├── wallet.js          # Create funding/settlement transactions\n  ├── dispute.js         # Handle disputes via Bitcoin Script\n  ├── test.js            # Run full workflow simulation\n  └── cli.js             # User-friendly CLI interface\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js installed\n- `.env` file configured (see below)\n\n### Setup Instructions\n\n```bash\n# Clone the repo\ngit clone https://github.com/yllvar/BitVM-Prediction.git\ncd BitVM-Prediction\n\n# Install dependencies\nnpm install\n\n# Run tests\nnode test.js\n\n# Or use the CLI\nnode cli.js\n```\n\n### Example `.env` File\n\n```env\nNETWORK=testnet\nORACLE_PRIVATE_KEY=cQqV9FJ2GzvXHwv5yXr2YRYC5xHk2Z4XH6oRjv8J4HJ9Xu3GfZ8\nCOINGECKO_API_URL=https://api.coingecko.com/api/v3/simple/price\n```\n\n## ⚙️ Features\n\n- **🔐 Bitcoin Security**: Even if someone tries to cheat, Bitcoin ensures fairness.\n- **💸 Cheap \u0026 Efficient**: Only disputed bets touch the blockchain.\n- **🤖 No Trust Needed**: Rules are enforced by code and Bitcoin.\n- **🕵️ Hidden Complexity**: Dispute logic stays off-chain until needed.\n\n## 🧪 Test Results\n\nWhen we tested it:\n\n| Action | Result | Time |\n|--------|--------|------|\n| Created Bet | Alice and Bob locked funds | 2 sec |\n| Checked Price | Got $104,327 from CoinGecko | 1 sec |\n| Settled Bet | Alice won automatically | 5 sec |\n| Simulated Dispute | Bitcoin enforced the rules | ~30 min (on testnet) |\n\n## 🌐 Technologies Used\n\n- **BitVM**: Off-chain computation with on-chain verification\n- **Taproot \u0026 MAST**: Hide complex scripts until needed\n- **PSBT**: Safe transaction building\n- **Schnorr Signatures**: Compact, efficient signatures\n- **CoinGecko API**: Real-time price data\n\n## 🚀 Future Roadmap\n\n- 👥 Add multi-party support (N-of-N multisig)\n- 🌐 Integrate decentralized oracles (like Chainlink)\n- 💻 Build a web UI for non-technical users\n- 🕵️ Implement watchtowers to prevent cheating\n\n## 📚 Want More?\n\nCheck out the [**ABSTRACT.md**](ABSTRACT.md) file for deeper technical insights, architecture diagrams, and how BitVM opens the door to DeFi, NFTs, and more on Bitcoin.\n\n---\n\n**💡 The Big Idea**: We proved that **Bitcoin can run complex apps** without compromising its core values — security, simplicity, and decentralization.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyllvar%2Fbitvm-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyllvar%2Fbitvm-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyllvar%2Fbitvm-prediction/lists"}