Shares 276 Views

New Bitcoin Caching Features Could Improve Block Verification

Cuckoo For Caching Bitcoin

Jeremy Rubin

In May 2012, Bitcoin developer Gavin Andresen added code to Bitcoin that caches results of signature verifications. “A node would check the cache to see if it was a properly validated signature”, explains Bitcoin coder Jeremy Rubin, who encourages developers of all levels to contact him (here’s his Twitter). “This would save nodes from the need to do an expensive ECDSA signature validation that they’ve already done before”.

While examining Bitcoin’s codebase, Mr. Rubin noticed inefficiencies in how Bitcoin blocks were processed, rooted in the design of this Signature Cache. He began looking at the design with the idea of easing this tension in mind.

“Imagine if every time you needed something, you had to go all the way home”, Mr. Rubin uses an analogy to describe Bitcoin’s original verification process. “It would be really tough to get through the day, especially around lunch time. But that’s why we carry backpacks. We can pack our lunch, pencils, books, and take them with us if we know we’ll need them later. We still have to go home sometimes if we need something we didn’t expect, but this happens infrequently”.

In programming, a ‘cache’ is a little bit like a backpack. “Bitcoin’s original signature cache was like trying to use a plastic bag with a tiny opening, half full of rocks, with holes in it as a backpack”, explicates Mr. Rubin, who worked on the code while contracting with Chaincode. “Due to the rocks, it was very heavy. Because of the holes, things would fall out all the time. Because it was a plastic bag, everything was disorganized and it took a while for you to find what you were looking for. Because of the tiny opening, you could only fit one hand in at a time and you can’t see what’s in your bag while you’re getting something or putting something in. But at the end of the day, having this bag is a lot better than having to go home so frequently”.

Cuckoo Cache, as Mr. Rubin analogizes, is like a backpack which has pockets and organizers, helping Bitcoin’s code knows where to look right away for the things it needs to verify transaction blocks.

“The openings are large enough and you can see what’s there while you’re taking something out”, says the twentysomething, who once had to fend off a sweeping subpoena for Bitcoin coding activities. “It’s not filled with heavy rocks for no reason. You forget something at home on occasion, and you still lose something every now and again, but not as frequently as when using the bag with the holes”.

Mr. Rubin believes fine-tuning Bitcoin’s code via upgrades like Cuckoo Cache, which is integrated in the forthcoming Bitcoin Core Version 0.14, can go a long way towards improving network efficiencies. He suggests, moreover, that improved caching structures could improve other facets of Bitcoin’s codebase.

Making Bitcoin More Efficient

“With Bitcoin, there are a lot of places in the codebase where we’ve used standard C++ data structures, because the standard library provides the simplest way to prototype many things, and these are capable of carrying the workload at first”, Mr. Rubin explained to “But as Bitcoin scales, there are many big wins to be had if we reconsider the way we store and process Bitcoin’s data”.

Optimizing these data structures, according to Mr. Rubin, is a particularly good place to get started with Bitcoin core development.

“Data Structure optimization is a great place to start contributing to Bitcoin because the problems are pretty self-contained. You don’t need to understand all of Bitcoin to get started, and it’s somewhat easy to measure and communicate your results. Through working on these problems, however, you begin to gain a deep understanding of how Bitcoin works at a low level”.

Mr. Rubin encouraged developers interested to find such a project, but looking for guidance on how to get started or feedback on their work, to reach out to him via email.

Are you cuckoo for Cuckoo Cache? Let us know in the comments below.

Images via Shutterstock, Twitter, and Github


You may be interested

shares13 views

Opinion | What is a Security Token Offering (STO) and Why You Need an Advisor

Brian Evans - Oct 08, 2018

About the Author: Jaron Lukasiewicz is the CEO and founder of Influential Capital. Jaron has been an executive in the industry since 2012, previously serving as CEO of Coinsetter, one…

shares18 views

World Economic Forum: Blockchains improve Global Economy

Brian Evans - Oct 08, 2018

Beginning as a technology for financial ledgers only, blockchains have grown to become the corporate hype word around the globe. It’s touted as the invention that will…

shares24 views

‘Rehypothecation’: More about the Wall Street Practice that Could Ruin Bitcoin

Brian Evans - Oct 08, 2018

Note: This is part 4 in a multi-part article series exploring rehypothecation and commingling in bitcoin and other cryptocurrency markets. Part 1 and part 2 are interviews…

Most from this category

%d bloggers like this: