Skip to content

Instantly share code, notes, and snippets.

View kcalvinalvin's full-sized avatar

Calvin Kim kcalvinalvin

View GitHub Profile
kcalvinalvin /
Last active March 14, 2024 08:11
Utreexo algorithms


Utreexo accumulator is a collection of proper merkle trees. All the merkle trees have 2 children or none.

Below is an example of adding 7 leaves to the tree. You can run the code I used to generate this at

This is an accumulator with 1 leaf. It has 1 root, which is also a leaf.

kcalvinalvin / sanity_test.go
Created August 29, 2022 06:41
Test function to verify that the code is incorrect
package patriciaaccumulator
import (
kcalvinalvin / reproduce-results.patch
Last active August 29, 2022 06:32
Patch to reproduce the results of the blog
diff --git a/bridgenode/genproofs.go b/bridgenode/genproofs.go
index 36f1117..cca31b8 100644
--- a/bridgenode/genproofs.go
+++ b/bridgenode/genproofs.go
@@ -110,6 +110,7 @@ func BuildProofs(
for ; height != knownTipHeight && !stop; height++ {
+ fmt.Println("on block", height)