-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbb6432
commit 423ae8e
Showing
16 changed files
with
210 additions
and
2 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @b-j-roberts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: Feature request | ||
about: suggest new feature | ||
title: "[feat] " | ||
labels: "feature" | ||
assignees: "" | ||
--- | ||
|
||
<!-- feature description --> | ||
|
||
#### References |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: Bug report | ||
about: create bug report | ||
title: "[bug] " | ||
labels: "bug" | ||
assignees: "" | ||
--- | ||
|
||
**ver:** | ||
|
||
<!-- reproducible report(current vs expected behavior) --> | ||
|
||
**How to reproduce:** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
name: Codebase improvement | ||
about: docs, ci, tooling, other | ||
title: "[dev] " | ||
labels: "dev" | ||
assignees: "" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- enter the gh issue after hash --> | ||
|
||
- [ ] issue # | ||
- [ ] follows contribution [guide](https://github.com/keep-starknet-strange/raito/blob/main/CONTRIBUTING.md) | ||
- [ ] code change includes tests | ||
|
||
<!-- PR description below --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
all | ||
# lame rules | ||
exclude_rule 'MD002' | ||
exclude_rule 'MD041' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
all | ||
# allow inline HTML for README fmt | ||
exclude_rule 'MD033' | ||
# badges trigger rule | ||
exclude_rule 'MD034' | ||
# README img serves as 'First Header' | ||
exclude_rule 'MD002' | ||
exclude_rule 'MD041' | ||
# TODO: disable/enable not working for all-contribs | ||
exclude_rule 'MD013' | ||
# Allow no endline at the end | ||
exclude_rule 'MD047' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: read-all | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: asdf-vm/actions/install@v3 | ||
- run: scarb fmt --check | ||
- run: scarb build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: check | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: read-all | ||
|
||
jobs: | ||
markdown: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
sudo gem install mdl | ||
mdl -s .github/linter/readme_style.rb README.md | ||
mdl -s .github/linter/base_style.rb .github | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: asdf-vm/actions/install@v3 | ||
- run: scarb test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,63 @@ | ||
# raito | ||
Bitcoin ZK client using Circle STARK proofs. | ||
<div align="center"> | ||
<h1>Raito âš¡</h1> | ||
<h2>Bitcoin ZK client written in Cairo.</h2> | ||
|
||
<a href="https://github.com/keep-starknet-strange/raito/actions/workflows/check.yaml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/keep-starknet-strange/raito/check.yml?style=for-the-badge" height=30></a> | ||
<a href="https://bitcoin.org/"> <img alt="Bitcoin" src="https://img.shields.io/badge/Bitcoin-000?style=for-the-badge&logo=bitcoin&logoColor=white" height=30></a> | ||
<a href="https://www.cairo-lang.org/"> <img alt="Cairo" src="https://img.shields.io/badge/Cairo-000?style=for-the-badge" height=30></a> | ||
|
||
</div> | ||
|
||
## About | ||
|
||
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](https://github.com/ZeroSync/ZeroSynchttps://github.com/ZeroSync/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. | ||
Design goals: | ||
|
||
- **Usability:** One-click install and run. WebAssembly compatibility for browser-based execution. | ||
- **Maintainability:** Emphasis on simplicity and clean code structure. | ||
- **Performance:** Optimized for speed and efficiency, leveraging STWO's next-generation prover. | ||
|
||
## Name reference | ||
|
||
Raito is a reference to Light Yagami (夜神月, Yagami Raito) from the manga/anime Death Note. | ||
|
||
Why ? | ||
|
||
- 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](https://github.com/keep-starknet-strange/shinigami) that enables verification of Bitcoin Script programs. Raito = Consensus and Shinigami = Execution. | ||
|
||
![Raito and Shinigami](./docs/img/memes/raito_shinigami_fusion.jpg) | ||
|
||
### Running | ||
|
||
```bash | ||
scarb cairo-run --available-gas=200000000 | ||
``` | ||
|
||
This will run the provided Bitcoin Script in Cairo. | ||
|
||
### Building | ||
|
||
```bash | ||
scarb build | ||
``` | ||
|
||
This will compile all the components. | ||
|
||
### Testing | ||
|
||
```bash | ||
scarb test | ||
``` | ||
|
||
This will run the test-suite for all op-codes, integration, and test Bitcoin Scripts. | ||
|
||
## References | ||
|
||
- [STWO](https://github.com/starkware-libs/stwo) | ||
- [Cairo](https://www.cairo-lang.org/) | ||
- [Circle STARK paper](https://eprint.iacr.org/2024/278) | ||
- [ZeroSync](https://github.com/ZeroSync/ZeroSync) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Code generated by scarb DO NOT EDIT. | ||
version = 1 | ||
|
||
[[package]] | ||
name = "raito" | ||
version = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "raito" | ||
version = "0.1.0" | ||
edition = "2023_11" | ||
|
||
[dependencies] | ||
starknet = "2.6.3" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// The engine is the main component that coordinates the verification of the Bitcoin consensus rules in Cairo. | ||
#[derive(Destruct)] | ||
pub struct Engine {} | ||
|
||
pub trait EngineTrait { | ||
fn new() -> Engine; | ||
fn check_consensus_rules(ref self: Engine) -> Result<ByteArray, felt252>; | ||
} | ||
|
||
pub impl EngineTraitImpl of EngineTrait { | ||
fn new() -> Engine { | ||
Engine {} | ||
} | ||
|
||
|
||
fn check_consensus_rules(ref self: Engine) -> Result<ByteArray, felt252> { | ||
return Result::Ok(""); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub mod engine; | ||
|
||
mod main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use raito::engine::EngineTrait; | ||
use raito::engine::EngineTraitImpl; | ||
|
||
fn main() { | ||
println!("Running Raito Bitcoin ZK client"); | ||
let mut engine = EngineTraitImpl::new(); | ||
let res = engine.check_consensus_rules(); | ||
if res.is_ok() { | ||
println!("Execution successful"); | ||
} else { | ||
println!("Execution failed"); | ||
} | ||
} |