It's easy to miss at first glance, the brilliance of some of the inventions behind Bitcoin. Like computers in an internet swarm being able to communicate and collaborate with each other quite routinely despite some of them lying deliberately with criminal or malicious intent. At the heart of this brilliance lie Merkle Trees; the subject of this article. It's a teaching article, with accompanying code (in Go).
Read the article.txt first. And then the code, starting with main.go in the src subdirectory.
Don't worry if you are not familiar with Go code; it's easy to read.