Skip to content

Commit 80b1338

Browse files
Implement the Pollard
Pollard is a middle-ground between full tree and Stump that allows holding only a subset of UTXOs, while still allowing proving those elements. This implementation only allows for full pollards, where all leaves are present. Allowing partial pollard will be accomplished later. The implementation uses interior mutability to work. A Pollard is different from a normal Binary Tree because nodes points to it's sibling, not their children. This makes recursive algoritms more evolved, specially during deletions. This implementation is all iteractive, and carefully uses interior mutability with Cell and RefCell. Those smart pointers allows runtime borrow checking, if some of the Borrowing Rules is broken, it panics. Here, we take care of not holding reference to the interior of a Cell or RefCell for too log, and not passing `mut ref` arround. Only a few functions with very limited scope can use `mut ref`s. A extensible collection of tests is also provided, to check for code correctness and soundness.
1 parent 5292b46 commit 80b1338

File tree

5 files changed

+806
-60
lines changed

5 files changed

+806
-60
lines changed

Cargo.lock

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ edition = "2018"
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88
[dependencies]
99
bitcoin_hashes = "0.12.0"
10-
lazy_static = "1.4.0"
1110

1211
[dev-dependencies]
1312
serde = { version = "1.0", features = ["derive"] }

0 commit comments

Comments
 (0)