A Bitcoin-native price oracle built on OP_NET, pushing live BTC/USD spot prices on-chain via smart contract interaction.
| Field | Value |
|---|---|
| Contract Address | opt1sqp630pm5450ratxnd55rwyjmq226gy2c5yayqfdg |
| Contract Hash | 0x74f381ba78cd46c6683969a41e11dbf83f62861faa675299c4091f360763a2c8 |
| Network | Bitcoin Testnet3 |
| Protocol | OP_NET v1 |
| Price Scale | ×10⁸ (satoshi precision) |
https://frontend-sigma-one-35.vercel.app
| Field | Value |
|---|---|
| Interaction TXID | cd3fbfa42cbb9b56ed5db3a07526131ce62dee07c4cf9a9306318871a5686e9f |
| Method | Emergency Protocol — signInteraction + manual mempool.space broadcast |
| Result | Oracle sync successful |
/contract — OP_NET smart contract (AssemblyScript)
/frontend — Cyberpunk UI dashboard (React + Vite + TypeScript)
/docs/demo — Screenshots and proof of work
cd frontend
npm install
npm run dev┌─────────────────────────────────────────────────────┐
│ Frontend (React) │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────┐ │
│ │ PriceCard │ │ PriceChart │ │ SyncButton│ │
│ │ Binance API │ │ Binance API │ │ OP Wallet │ │
│ └──────────────┘ └──────────────┘ └───────────┘ │
└─────────────────────────────────────────────────────┘
│ │
▼ ▼
Binance Public API window.opnet.web3.signInteraction
(spot + klines, no key) + POST mempool.space/api/tx
│ │
▼ ▼
Live BTC/USD price PriceOracle.setPrice(uint256)
on Bitcoin Testnet3
setPrice(uint256)— owner writes price scaled ×10⁸getPrice()→(uint256 price, uint256 lastUpdatedBlock)- Compiled to WASM, deployed via OP_NET deploy transaction
services/coinGecko.ts— Binance public API (spot + 1h klines)services/contractService.ts— read viabtc_callRPC; write via OP WalletsignInteraction→ manual broadcast to mempool.spacecomponents/PriceCard.tsx— live Binance card + on-chain oracle cardcomponents/PriceChart.tsx— 24h price chartcomponents/SyncButton.tsx— one-click oracle sync
The OP Wallet extension's internal Bitcoin node caches UTXOs as spent after failed broadcasts. The fix:
- Fetch confirmed UTXOs from mempool.space (
opt1…→tb1…address conversion) - Call
signInteraction— wallet signs locally, does not broadcast - POST raw funding + interaction tx hex directly to
mempool.space/api/tx
# Contract
cd contract
npm install
cp .env.example .env # fill WALLET_WIF, MLDSA_PRIVATE_KEY, CONTRACT_ADDRESS
node deploy.mjs # deploy to testnet
node set-price.mjs # push initial price
# Frontend
cd frontend
npm install
cp .env.example .env # fill VITE_CONTRACT_ADDRESS, VITE_CONTRACT_HEX
npm run devNETWORK=testnet
RPC_URL=https://testnet.opnet.org
WALLET_WIF=<your WIF key>
MLDSA_PRIVATE_KEY=<2560-byte hex>
CONTRACT_ADDRESS=opt1sqp630pm5450ratxnd55rwyjmq226gy2c5yayqfdg
CONTRACT_HEX=0x74f381ba78cd46c6683969a41e11dbf83f62861faa675299c4091f360763a2c8
VITE_CONTRACT_ADDRESS=opt1sqp630pm5450ratxnd55rwyjmq226gy2c5yayqfdg
VITE_CONTRACT_HEX=0x74f381ba78cd46c6683969a41e11dbf83f62861faa675299c4091f360763a2c8
VITE_OPNET_RPC_URL=https://testnet.opnet.org
- Live BTC/USD spot price via Binance public API (no key required)
- 24-hour price chart with neon SVG rendering
- One-click oracle sync — pushes price on-chain via OP Wallet
- Cyberpunk fintech UI with Orbitron + Share Tech Mono fonts
- Auto-refresh every 30s, oracle retry every 15s
| Layer | Tech |
|---|---|
| Contract | OP_NET / AssemblyScript |
| Frontend | React 18, Vite 5, TypeScript 5 |
| Wallet | OP Wallet (window.opnet) |
| Price | Binance REST API |
| Network | Bitcoin Testnet3 / OP_NET |
