MSghais/raito

Bitcoin ZK client written in Cairo.

★ 0Forks 0CairoGitHub ↗Compare

Project website ↗

README

raito-logo

Bitcoin ZK client written in Cairo.

GitHub Workflow Status Bitcoin Cairo Exploration Team

Overview

Raito is a zero-knowledge Bitcoin client implemented in Cairo. It aims to provide trustless validation of the Bitcoin blockchain through STARK proof verification. It is heavily inspired by ZeroSync project.

Disclaimer: This project is in the early stages of development and should not be used in production. It will evolve rapidly, expect breaking changes.

flowchart TB
Pnm1(STARK proof of the chain state<br>up to the block <i>n - 1</i>,<br> including utxo accumulator) --> Vp(zk verifier)
Bn(blocks <i>n..m</i>) ----> Vb

subgraph Cairo
    Vp{{STARK verifier}}-->ChS(verified chain state)
    ChS --> Vb{{validate block<br>against the chain state}}
    Vb --> ChS
end

Vb --> Pn(STARK proof of the chain state<br>up to the block <i>m</i>,<br> including utxo accumulator)

style Bn fill:pink
style Pn fill:lightgreen
style Pnm1 fill:lightgreen
style ChS fill:greenyellow
style Vp fill:gold
style Vb fill:gold
Loading

Raito, at its core, accepts two inputs: a batch of consecutive blocks n to m and a STARK proof of the state of the chain up to block n−1. It ensures that the historical chain state is valid by verifying the STARK proof. Then, it produces a new chain state by applying the new blocks on top of the historical state. As a result, a proof of the new state is generated.

Applications

Although this is a highly experimental project without immediate plans for deployment, there are many potential applications:

  • light clients
  • IBD speedup
  • non custodial bridges
  • layer 2s

Roadmap

Milestone 1 - Block Verification

  • header verification
    • block hash
    • proof-of-work
    • median time
    • difficulty adjustment
  • transaction verification
    • tx hash
    • tx merkle root
    • verify transaction fee
  • block verification
    • verify coinbase tx
  • verify scripts
    • integration with Shinigami, tbd
  • integration testing
    • test on individual historical blocks

Milestone 2 - Utreexo

  • fetch utreexo from some kind of bridge node, tbd
  • use utreexo to verify tx inputs

Milestone 3 - Real Data

  • feed it with real data
  • test that you can produce and verify proofs of individual blocks

Milestone 4 - Recursive Verification

  • verify chain proofs with cairo verifier, tbd

Name reference

Raito is a reference to Light Yagami (夜神月, Yagami Raito) from the manga/anime Death Note.

  • Raito in Japanese means "Light", which in turns can refer to Lightning ⚡ (and hence both a reference to speed of verification of the Bitcoin blockchain using a ZKP and a reference to the Lightning Network)
  • Raito can work in tandem with Shinigami that enables verification of Bitcoin Script programs. Raito = Consensus and Shinigami = Execution. Since Shinigami was named after Ryuk (Shinigami in Death Note), Raito was named after Light (Raito in Death Note).
  • What Raito writes in the Death Note always happen, so you can see it as a source of truth, similarly to how you use a Zero-Knowledge Proof to verify the integrity of a computation.

Raito and Raito

Contact

Usage

This will compile all the components:

scarb build

This will run the test-suite:

scarb test

References

Contributors ✨

Thanks goes to these wonderful people (emoji key):

A₿del ∞/21M 🐺 - 🐱
A₿del ∞/21M 🐺 - 🐱

💻
Maciej Kamiński @ StarkWare
Maciej Kamiński @ StarkWare

💻
Brandon R
Brandon R

💻
Tristan
Tristan

💻
Jean-Michel
Jean-Michel

💻
lomasson
lomasson

💻
Michael Zaikin
Michael Zaikin

💻
Harsh Pratap Singh
Harsh Pratap Singh

💻
Xavek
Xavek

💻
Olufemi Olumaiyegun
Olufemi Olumaiyegun

💻
MSG
MSG

💻
Mubarak Muhammad Aminu
Mubarak Muhammad Aminu

💻
oluwapeski
oluwapeski

💻
Steven
Steven

💻
Yusuf Habib
Yusuf Habib

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Contributors

maciejkaTAdev0harsh-ps-2003olufemiolumaiyegunAbdelStarkmanlikeHBMSghaism-kusJeanmichel7mubarak23Xaveklana-shanghailomassonstevencartaviab-j-roberts

Issues