# Exclusion Complete Binary Merkle Tree A merkle tree based on Nervos [Complete Binary Merkle Tree](https://github.com/nervosnetwork/merkle-tree) to support verifiing a leaf is not on a certain tree. ## Example Usage ```rust type StrKey = &'static str; type StrLeaf = SimpleLeaf; type StrRangeLeaf = SimpleRangeLeaf; // A helper to compute root and build proof type StrExCBMT = SimpleExclusionCBMT; // Can be seen as a black list let all_leaves: Vec = vec!["b", "e", "g", "x"] .into_iter() .map(StrLeaf::new_with_key) .collect(); let root = StrExCBMT::compute_root(&all_leaves); // The keys not in the black list let excluded_keys = vec!["f", "y", "z", "a"]; let proof = StrExCBMT::build_proof(&all_leaves, &excluded_keys).unwrap(); assert_eq!( proof .range_leaves() .iter() .map(|l| (*l.key(), *l.next_key())) .collect::>(), vec![("e", "g"), ("x", "b")] ); assert!(proof .verify_exclusion(&root, &excluded_keys) .is_ok()); ```