Brove Technical Architecture
Brove is an infrastructure that enables demonstrating real Bitcoin activity within the Starknet ecosystem. Using Raito, Brove converts past Bitcoin transactions into verifiable on-chain cryptographic proofs, enabling Starknet applications to trust their users’ Bitcoin history.🎯 The Core: Bitcoin → Starknet
What Does Brove Do?
Brove verifies that you actually interacted with Bitcoin and brings that proof to Starknet.It is not about general activity or tokens—it is specifically about demonstrating that you sent, received, or participated in real Bitcoin transactions in specific Bitcoin blocks.
Why Is This Important?
- Starknet applications can trust verified Bitcoin history
- Users can prove real Bitcoin experience without revealing private keys
- Eliminates the need to trust third parties to validate Bitcoin activity
- Connects two ecosystems: Bitcoin’s security with Starknet’s programmability
🧰 Development Kit
Compatible Bitcoin-Starknet Versions
- Starknet Devnet:
v0.4.0 - Scarb:
v2.12.1 - Snforge:
v0.48.1 - RPC:
v0.8.0 - Bitcoin Core:
v24.0+
Other information about SDK and Library
- TypeScript/JavaScript SDK: Proof generation from Bitcoin Core. Install with
npm install bitcoin-on-starknet. - Cairo Library Raito: Interprets Bitcoin data inside smart contracts.
Compatible Wallets
Bitcoin Wallets: Starknet Wallets:Core Infrastructure
Bitcoin + Raito + S-two + Brove + StarknetSystem Components
- Bitcoin Network: The ultimate source of truth for transactions.
- Raito: A Cairo library that acts as a Bitcoin Light Client, processing Bitcoin data structures for use in Brove.
- S-two: StarkWare’s next-generation prover that validates the correct state using STARK proofs.
- Brove Contracts: Smart contracts that validate inclusion proofs and Bitcoin metadata to generate custom proofs and vaults.
Bitcoin → Starknet Verification Flow
- A user performs a Bitcoin transaction (e.g., in block
150,000). - Brove retrieves the transaction and its block from a Bitcoin node.
- Raito processes the Bitcoin data structures in Cairo, verifies them, and registers the block header on Starknet, proven by S-two with STARK proofs.
- Brove generates an inclusion proof (Merkle proof + metadata).
- The Starknet application verifies the proof on-chain.
- The user gains access to services based on their verified Bitcoin activity.
⚡ Raito - Bitcoin Client on Starknet
Raito provides Bitcoin data structures in Cairo, enabling verification of transactions and headers directly in smart contracts.Key Capabilities
- Transaction Parsing: Decode and validate Bitcoin transaction formats in Cairo.
- Block Header Processing: Validate Bitcoin block headers and chain continuity.
- Merkle Proof Verification: Validate cryptographic proofs of inclusion.
- Script Interpretation: Support Bitcoin scripts (P2PKH, P2SH, SegWit, Taproot).
Main Functions
- Block Header Verification: Register and validate Bitcoin headers with Proof-of-Work.
- Canonical Chain Maintenance: Link verified blocks to their heights for consistency.
📦 Installation and Deployment
Environment Variables
Configure snfoundry .env to deploy your smart contracts by configuring on sepolia or mainnet.Deploy Contracts
Terminal 1: For install all dependenciesConfigure Smart Contract
- Go to Debug in the app http://localhost:3000/debug (⚠️ Do not copy SC the CLI).
- Copy the addresses of the Smart Contracts.
- Replace the following values inside the Next.js .env file:
targetNetworks: [chains.mainnet] or [chains.sepolia]
With these settings we have everything ready to set up the local.
⚙️ Raito Setup
Now we will configure Raito to be able to have our Bitcoin Light Client in Cairo and be able to verify the state of the Bitcoin chain and generate the inclusion proofs with Brove. Terminal 2:- If build fails for Cairo
2.12.0due toassumevalid, comment out# unsafe-panic = trueinScarb.toml.
⚙️ Server Setup
- Server is ready to receive Bitcoin transactions and generate inclusion proofs using Raito + S-two.
💳 Create BroveBoxes and Credits
- Configure contract addresses in Next.js
.env. - Add in
http://localhost:3000/debugSC Brove Credit inset_authorized_consumerwith address the BroveBoxes - Add in
http://localhost:3000/debugBroveBoxes inwhitelist_creatorthe address you like add as creator for create BroveBoxes. - Use in
http://localhost:3000/debugtheset_brove_identity_contractin BroveBoxes contract. - Use in
http://localhost:3000/debugtheset_brove_boxes_contractin Brove Identity contract to link BroveBoxes with Brove Passport.
- Purchase credits via UI:
- For Create BroveBox via UI:
- Ensure you have sufficient tokens (default: 5 USDC) to create BroveBoxes. Fill in the requirements you want to demonstrate for the address you added to the whitelist. Verify that the Raito server is running and that both your Bitcoin and Starknet wallets are connected.
- Once the BroveBox is created, click on it and select Sign Message. Signing the message with ECDSA will trigger verification in Starknet. If everything is correct, the server will process the request, generating the proper proofs and invoking S-two to produce the correct block header and transaction data in zero-knowledge. This ensures that your Bitcoin transactions meeting the defined requirements are correctly verified on Starknet.
http://localhost:3000/debugin each contract, specifying the values as U64.