Proof-of-concept on how to solve Bitcoin's light node sync problem with zkSNARKs

Overview

BTC Warp

Prove and verify the longest Bitcoin PoW chain

BTC Warp is a proof-of-concept system that aims to solve the client-syncing problem for Bitcoin by using zkSNARKs to prove the validity of the longest valid proof-of-work chain.

A large barrier of entry into self-hosted nodes for Bitcoin and other chains is the cost to store all historical state and the time to sync with the network. Syncing can take several days and the hardware costs to store and stay in sync with the p2p network can be steep.

To solve this, one entity can generate a ZK proof of validity for the longest valid Bitcoin chain once and others can verify the proof to get the last valid BTC block.

For more details, read our blog post here!

Running BTC Warp

BTC Warp is made up of several systems that need to run together to generate proofs. Infrastructure flow

We start with the Nakamoto light client that listens to the BTC p2p network for new blocks. Nakamoto is a Rust Bitcoin light client focused on privacy. When the light client service initiates a full sync or detects a new block, it sends block headers to the zkSNARK prover to generate proofs and store them. The proofs are then served to the end user.

BTC Warp provides an btc-warp library that interfaces between the ZK circuits and infrastructure. First, compile into a binary executable using cargo build --release and add to path to chmod +x target/release/btc-warp. To run a service, cd into the root of this repo and run the commands listed below.

  • Run light client services:
    bash lc-service.sh
    • This command runs the following two commands together:
    • Light client: ./btc-warp light-client
      • This runs the light client service that listens to the Bitcoin p2p network. We need the light client service when generating our initial proof and to update our proof for newly generated blocks
    • Light client API: ./btc-warp lc-api
      • This runs the simple REST API server that serves blocks and parent hashes that the light client service has stored. The light client API is useful for supplying block headers for proof generation and should run alongside the light client service.
  • Generate historical proof:
    ./btc-warp historical --layer <LAYER> --index <INDEX> --child-proofs-per-layer <CHILD_PROOFS_PER_LAYER>... --num-proofs-per-layer <NUM_PROOFS_PER_LAYER>... --postfix <POSTFIX>
    • This command should be run in an AWS container to generate a proof of all blocks the light client service has seen so far. Proof generation happens in layers for parallelization, so arguments such as layer_num, index, and other information are passed in. This command uses the light client API to get block headers and stores the generated proof in a AWS S3 bucket.
  • Generate next block proof:
    ./btc-warp next-block --block-index <BLOCK_INDEX> --child-proofs-per-layer <CHILD_PROOFS_PER_LAYER>... --postfix <POSTFIX>
    • This command should be run in an AWS container to generate a proof of the "next" block the light client as seen. The next-block command helps the light client catch up to the current longest Bitcoin PoW chain after generating a historical proof using the command above. This command uses the light client API to get block headers and stores the generated proof in a AWS S3 bucket.

Acknowledgements

We would like to acknowledge Geometry and the team at ZeroSync, a project to generate STARK proofs of the Bitcoin blockchain. BTC Warp was developed independently by the Succinct Labs team, starting as a hackathon idea at ETH San Francisco, with the help of Jesse Zhang, Patrick Insinger, and Marc Ziade.

You might also like...
Blazingly fast Rust CLI app to sync data from a folder of excel workbooks into generated c# code for unity usage
Blazingly fast Rust CLI app to sync data from a folder of excel workbooks into generated c# code for unity usage

Extensions supported ( .xls, .xlsx, .xlsm, .xlsb, .xla, .xlam, .ods ) Speed Test Image shows the results of 5000defs synced from 2 workbooks and 5 she

A reconciliation service to sync a key-value map over multiple instances.

reconcile-rs Docs This crate provides a key-data map structure HRTree that can be used together with the reconciliation Service. Different instances c

A parser combinator that is fully statically dispatched and supports both sync/async.

XParse A parser combinator that is fully statically dispatched and supports both sync & async parsing. How to use An example of a very simple JSON par

global state management for dioxus built on the concept of atoms. currently under 🏗

Fermi: A global state management solution for Dioxus, inspired by Recoil.Js Fermi provides primitives for managing global state in Dioxus applications

Interesting protection concept i came up with.

Note If this reprository is useful to you in in any shape or form please give it a star. How it works This protection works by taking all the assembly

Benson, the light that warms all

benson Benson, the light that warms all Commands Command Info !benson status Checks benson bot status !benson join_vc id Joins a voice channel by ID

Build light & secure cross-platform applications with a web-based UI
Build light & secure cross-platform applications with a web-based UI

Millennium Icon by XFaon. *Stats are from Tauri and may not be fully accurate. Millennium is a cross-platform webview framework written in Rust. With

A ln scraper to read light novels and watch anime in your terminal (Written in rust)

Readme Table of content Why use kami Dependencies Install Linux/mac Windows Honorable mentions Why use kami Well its a fast and easy way to watch anim

A dark and light Neovim theme written in fennel, inspired by IBM Carbon.
A dark and light Neovim theme written in fennel, inspired by IBM Carbon.

oxocarbon.nvim Note: The old rust version can be found on the rust branch of this repository Oxocarbon is looking for ports! If you're a user of anoth

Owner
Succinct
Succinct
Red-blue graph problem solver - Rust implementation

Red-blue graph problem solver - Rust implementation The problem is the following: In a directed graph, each node is colored either red or blue. Furthe

Thomas Prévost 2 Jan 17, 2022
Benchmarking C, Python, and Rust on the "sp" problem

Fast SP Various implementations of the problem in this blog post. Requirements To run this, you will need Rust Nightly and Python 3.8+ with numpy. Rus

Eddie Antonio Santos 2 Jul 13, 2023
solve scripts for all 3 of @0xhana's paradigm ctf challs!

hana solana ctf ok like all the best software engineers i got the technicals done on time and under budget but left documentation for future me. its n

ra 21 Nov 21, 2022
Trying to solve Advent of Code 2022 in 25 different languages (1 day = 1 language)

Advent of Code 2022: 15/25 langs I’ll try to solve this Advent of Code using different language for each day. Any programs needed to run the code will

Max “Goldstein” Siling 2 Dec 15, 2022
Terminal UI for leetcode. Lets you browse questions through different topics. View, solve, run and submit questions from TUI.

Leetcode TUI Use Leetcode in your terminal. Why this TUI: My motivation for creating leetcode-tui stemmed from my preference for tools that are lightw

Akarsh 8 Aug 10, 2023
Nvm - Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Node Version Manager Table of Contents Intro About Installing and Updating Install & Update Script Additional Notes Troubleshooting on Linux Troublesh

nvm.sh 63.8k Jan 7, 2023
Abuse the node.js inspector mechanism in order to force any node.js/electron/v8 based process to execute arbitrary javascript code.

jscythe abuses the node.js inspector mechanism in order to force any node.js/electron/v8 based process to execute arbitrary javascript code, even if t

Simone Margaritelli 301 Jan 4, 2023
Provide CRUD CLI for Moco Activities with Jira Cloud Sync Option for faster time tracking.

Moco CLI Provide CRUD CLI for Moco Activities with Jira Cloud Sync Option for faster time tracking. Available commands Login Jira Must be called befor

Emanuel Vollmer 7 Nov 18, 2022
A Yocto setup and management tool that helps you keep your environment up-to-date and in-sync with your team

yb (Yocto Buddy) yb is designed to make it easy to setup and (perhaps more importantly) keep Yocto environments up-to-date and in-sync with your team.

null 13 Oct 31, 2022
Keeps `.env` files in sync with `env.sample`.

envsync This is a Rust port of env-sample-sync. It keeps .env files in sync with env.sample. It checks whether the local repository has an .env file a

Matthias Endler 2 Dec 22, 2022