github.com/cbergoon/merkletree
v0.5.0
#2450 most downloaded on Go modules
cbergoon/merkletree
What this package is like to depend on
Last release 10 days ago
14 Aug 2026
Release timing varies
gaps range from 2 months to 3.5 years
Most releases are documented
notes for 4 of 5 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
15 releases · first in 2017
4 releases in the last 12 months
see the full history below
Release timeline
15 releases · Jun 2017 to Aug 2026Releases
latest 15-
v0.5.1-0.20260814060754-702c0a0e6c2514 Aug 2026 pre-releaseNothing published for this version
-
v0.5.014 Aug 2026Release notes
Open source →Proof generation and verification, mainly.
Locating content was a linear scan, making a single proof O(n) and a full set
O(n squared). WithLeafIndex, GetMerklePathByIndex and the AppendMerklePath forms
take that to a map probe, a direct index, and zero allocations respectively.VerifyProof checks a proof against a root without the tree, which is what a light
client actually needs and what the package could not previously do.WithParallelism spreads content hashing across goroutines, off by default because
it calls Content.CalculateHash concurrently.VerifyTree and the binary decoder allocate substantially less.
The RFC 6962 construction is now checked against the Certificate Transparency
reference vectors, and the default construction against other implementations of
the same folklore. Both live in nested modules, so merkletree still has no
dependencies.All additive; no existing API changed.
-
v0.4.014 Aug 2026Release notes
Open source →Adds serialization and an opt-in RFC 6962 construction, and fixes four
correctness bugs. The default construction is unchanged: roots, proofs and
indexes are byte for byte identical to v0.3.0.New:
- Marshal/Unmarshal for binary, JSON and gob, closing #13. A tree is encoded
as the seed it rebuilds from, and the recorded root makes decoding
self-checking - NewTreeWithOptions, with WithHasher, WithSortedSiblings and WithRFC6962
- WithRFC6962 prefixes leaf and interior hashes and splits odd node counts
rather than duplicating them, closing the second preimage weakness and
CVE-2012-2459 for trees that opt in - Sorted() and RFC6962() accessors
- ErrNoContent, ErrNilContent and ErrContentNotFound sentinels
Fixed:
- VerifyTree recomputed from content but never checked the hashes recorded on
the nodes, so an edited interior hash went unnoticed - a nil entry in the content slice panicked instead of returning an error
- Node.sort was dead
Behaviour changes, same signatures:
- GetMerklePath returns ErrContentNotFound for content that is not in the
tree, where it previously returned nil, nil, nil - VerifyTree is stricter, and now rejects a tree whose stored node hashes have
been edited
- Marshal/Unmarshal for binary, JSON and gob, closing #13. A tree is encoded
-
v0.3.013 Aug 2026Release notes
Open source →Modernized tooling and fixed four bugs. No API changes, and roots, proofs
and indexes are byte-identical to v0.2.0.- go 1.21 is now the minimum (was 1.12)
- GitHub Actions replaces Travis
- VerifyContent now compares against the tree's merkle root
- sortAppend no longer writes into its callers' spare capacity
- RebuildTree no longer promotes the odd-count padding leaf to real content
- GetMerklePath tells left from right by node identity, not by hash
-
v0.2.1-0.20230201134527-59b506280c4d01 Feb 2023 pre-releaseNothing published for this version
-
v0.2.021 Aug 2019 -
v0.1.021 Aug 2019Nothing published for this version
-
v0.0.0-20230201134527-59b506280c4d01 Feb 2023 pre-releaseNothing published for this version
-
v0.0.0-20190821184033-b76d0d18fef721 Aug 2019 pre-releaseNothing published for this version
-
v0.0.0-20190307191648-015148bca40007 Mar 2019 pre-releaseNothing published for this version
-
v0.0.0-20181226014223-2111568b555826 Dec 2018 pre-releaseNothing published for this version
-
v0.0.0-20180912145856-05d5987faac412 Sep 2018 pre-releaseNothing published for this version
-
v0.0.0-20180712123212-348a355d86ed12 Jul 2018 pre-releaseNothing published for this version
-
v0.0.0-20180228022759-0e68ec9a138d28 Feb 2018 pre-releaseNothing published for this version
-
v0.0.0-20170620034019-217f84c78dda20 Jun 2017 pre-releaseNothing published for this version