Skip to content

Commit d891d69

Browse files
Merge pull request #39 from Davidson-Souza/add-readme
Add readme and cargo.toml required keys
2 parents d2ab91f + d6471d2 commit d891d69

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name = "rustreexo"
33
version = "0.1.0"
44
authors = ["Calvin Kim <calvin@kcalvinalvin.info>"]
55
edition = "2018"
6+
description = "A Rust implementation of Utreexo"
7+
license = "MIT"
8+
repository = "https://github.com/mit-dci/rustreexo"
9+
readme = "README.md"
10+
homepage = "https://github.com/mit-dci/rustreexo"
611

712
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
813
[dependencies]

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1-
# rustreexo - Utreexo in rust
1+
# rustreexo - Utreexo in rust
22

3-
This is an on-going library to implement/port the golang Utreexo code to Rust.
3+
![Build Status](https://github.com/mit-dci/rustreexo/actions/workflows/rust.yml/badge.svg)
4+
![License](https://img.shields.io/crates/l/rustreexo)
5+
![Version](https://img.shields.io/crates/v/rustreexo)
6+
![Downloads](https://img.shields.io/crates/d/rustreexo)
7+
8+
Utreexo is a dynamic hash-based accumulator designed to be used as a set membership proof system and it is used in the Bitcoin network to compress the UTXO set. This is a pure-rust implementation of the accumulator, allowing proving and verifying set membership proofs.
9+
10+
## Usage
11+
12+
Rustreexo provides two basic data structures to represent the accumulator, `Stump` and `Pollard`. `Stump` is a lightweight version of the accumulator that only keeps the roots, and therefore only uses `O(log n)` space. `Pollard` is a more complete version of the accumulator that keeps the full tree, and therefore uses `O(n)` space. However, both data structures implements the same algorithms, so a proof generated by a `Pollard` is meant to be verified by a `Stump`. Here's how to use the `Stump`:
13+
14+
```rust
15+
use rustreexo::accumulator::stump::Stump;
16+
17+
let stump = Stump::new();
18+
// Modify the accumulator, adding UTXOs and removing STXOs, that are proved by del_proof
19+
let (stump, _) = stump.modify(utxos, stxos, del_proof).unwrap();
20+
// Verify a proof for a UTXO
21+
assert!(stump.verify(utxo_proof).unwrap());
22+
```
23+
24+
for a complete example, see `examples/`.
25+
26+
## Testing
27+
28+
This library contains an exhaustive test suite that covers all the algorithms implemented. To run the tests, simply run `cargo test`. We test for internal code sanity and cross-test with values generated by the [utreexo](https://github.com/utreexo/utreexo) lib.
29+
30+
## License
31+
32+
rustreexo is released under the terms of the MIT license. See [LICENSE](LICENSE) for more
33+
information or see https://opensource.org/licenses/MIT.
34+
35+
## References
36+
37+
- [Utreexo: A dynamic hash-based accumulator optimized for the Bitcoin UTXO set](https://eprint.iacr.org/2019/611.pdf)
38+
- [Dev++ 03-09-EN | Acumulator Based Cryptography & UTreexo](https://www.youtube.com/watch?v=xlKQP9J88uA)
39+
- [What is UTreeXO? with Calvin Kim](https://www.youtube.com/watch?v=IcHW6RsZR7o)
40+
- [Rustreexo](https://blog.dlsouza.lol/bitcoin/utreexo/2023/07/07/rustreexo.html)
41+
42+
## Contributing
43+
44+
Contributions are welcome! Please feel free to submit a Pull Request.

0 commit comments

Comments
 (0)