Research: Relayer Incentive Design
Author: Research Date: 2026-06-22 Status: CompleteOverview
Writz uses stateless SPV (no on-chain header chain), which means the header relay problem is substantially simpler than BTC Relay’s approach. However, users still need a reliable source of Bitcoin block headers and Merkle proofs to construct their SPV proofs. This document designs the relayer service and its incentive model.The Stateless SPV Relayer Difference
BTC Relay’s failure (stateful approach)
BTC Relay required relayers to continuously submit every Bitcoin block header to Ethereum. When fee revenue dropped, relayers stopped. No headers = system dead.Writz’s approach (stateless)
Writz does NOT store Bitcoin block headers on Stellar. Instead:- Users provide the headers themselves at verification time
- The Soroban contract verifies the provided headers on-demand
- No continuous relay is required
What the Relayer Actually Does
When a user wants to prove a Bitcoin deposit to Soroban, they need:- The raw Bitcoin transaction (containing their P2WSH output)
- The Merkle proof for that transaction within its block
- The block header for that block
- A chain of N block headers connecting that block to a recent, trusted checkpoint
- Maintains a connection to a Bitcoin full node
- Given a txid, fetches and packages all of the above into a ready-to-use SPV proof bundle
- Returns the bundle to the user’s browser for submission to Soroban
Relayer Architecture Options
Option A: Writz-Operated Centralized Relayer
A single Bitcoin full node + REST API operated by Writz. Endpoint:Option B: Decentralized Relayer Network
Multiple independent operators run relayer nodes. Users can query any of them. Operators are paid per proof request. Pros: No single point of failure. Censorship resistant. Cons: Adds complexity. Overkill for Phase 1 where user volume is small. Recommendation: Start with Option A (Phase 1), with a public API that any third party can independently implement. Design the API spec openly so competitors or community members can run alternative relayers. Progressively decentralize as the protocol grows.Option C: Pure User Self-Service
No Writz-operated relayer. The frontend guides users to fetch their own proof from public APIs. Pros: Maximum decentralization. No ongoing infrastructure cost. Cons: Very poor UX. Most users cannot fetch and format Merkle proofs manually. Verdict: Suitable as a fallback mode, not as the primary experience.Relayer Incentive Model (for Decentralized Phase 2)
When Writz launches a decentralized relayer network, relayers need economic incentives to operate reliably.Fee model
Per-proof fee: Users pay a small fee (e.g., 1,000 satoshis in USDC equivalent ~$1) when requesting a proof bundle. This fee is:- Charged in USDC on Stellar (simplest for users)
- Collected by the PrivateLend contract as part of the deposit transaction
- Distributed to the relayer that provided the proof bundle
Liveness guarantee
Unlike BTC Relay, stateless SPV doesn’t require 24/7 relayer availability. Users only need a relayer when making a transaction. A relayer that’s offline 90% of the time is still useful — as long as it responds when a user needs it. Minimum viable liveness: A relayer that responds within 60 seconds and has >99% uptime over 30-day windows can participate.Public Data Sources (User Fallback)
If the Writz relayer is unavailable, users can construct their own SPV proof from public sources:| Source | What it provides | How to use |
|---|---|---|
| Blockstream Esplora API | Raw transaction, Merkle proof, block header | GET https://blockstream.info/api/tx/{txid}/merkle-proof |
| mempool.space API | Same as Blockstream | GET https://mempool.space/api/tx/{txid}/merkle-proof |
| Bitcoin Core RPC | Full node access, all data | bitcoin-cli gettxout, getblock, gettxoutproof |
Alternative: zkRelay (Phase 2+ Consideration)
Research found zkRelay — a ZK-SNARK-based relay that batches Bitcoin header validation off-chain. Instead of submitting 6 raw headers, a prover submits one ZK proof that 6 (or 504) headers are all valid. Cost reduction: 187× cheaper than per-header verification (achieved in Ethereum research). For Writz: If the raw block header chain verification becomes a cost concern (especially for headers with very high difficulty requiring large PoW numbers), zkRelay-style header batching could significantly reduce the Soroban transaction cost of the SPV verification step. Not for Phase 1. zkRelay adds circuit complexity and a trusted setup. Start with raw header verification; switch to zkRelay batching if needed in Phase 2.Summary
| Decision | Choice | Rationale |
|---|---|---|
| Relayer type (Phase 1) | Writz-operated API | Simple, fast to ship, adequate for early users |
| Relayer type (Phase 2) | Decentralized with fee incentives | As user volume grows, decentralize for resilience |
| Fallback | User self-service from public APIs | Eliminates complete dependency on Writz relayer |
| Fee model | $1 per proof request (paid in USDC) | Fair compensation, low burden on user |
| zkRelay adoption | Phase 2+ if needed | Only if header verification becomes a cost bottleneck |
| Liveness guarantee | Convenience service, not critical path | Stateless SPV means any Bitcoin data source works |
Last updated: 2026-06-22 Sources: zkRelay paper · BTC Relay GitHub · Blockstream Esplora API · TrustBlink: zkSNARK relay