How to Experiment with Mako: A C89 Bitcoin Reimplementation

Mar 9, 2023 | Blockchain

Mako, a from-scratch Bitcoin reimplementation, is crafted in almost-C89. It’s designed with the goal of running on virtually any POSIX.1-2001 operating system, as well as Windows XP and above. This article serves as a guide for experimenting with Mako’s features while also providing insights on troubleshooting common issues.

Why Use Mako?

Mako stands apart from other implementations due to its minimal dependencies and reusable architecture. The core library, known as libmako, does not handle any input/output operations and encapsulates almost all tools needed for Bitcoin operations. Meanwhile, the full node functionality resides in libnode, making Mako an attractive option for developers interested in a straightforward and portable codebase.

Getting Started with Mako: Build and Usage

Here’s how to build and run Mako for experimentation:

sh$ cmake . -DCMAKE_C_FLAGS=-g -DCMAKE_BUILD_TYPE=Release
sh$ make

Executing the above commands on your terminal will produce two important binaries: mako and makod. These binaries mimic the functionalities of bitcoin-cli and bitcoind respectively, allowing you to work closely with the Bitcoin protocol.

Current Development Status

It’s crucial to note that Mako is under heavy development, and thus it’s not advisable to use it in production environments. Some essential missing features include:

  • Various RPC calls (e.g., getblocktemplate)
  • The entire wallet RPC and wallet functionality
  • Incompleteness in some consensus policy rules (supports softforks up to segwit)
  • Additional tests that need to be written

Understanding Mako with an Analogy

Think of Mako as a chef attempting to create a new recipe for a dish. The chef decides to do everything from scratch, because the existing recipes (or implementations) have too many variations based on personal preferences (dependencies). Mako ensures each ingredient (data structure) is crafted without relying on store-bought alternatives (C standard library), allowing for precise control over the final dish (Bitcoin functionality). Since Mako is a new recipe, some ingredients are still missing or poorly defined — that’s why it’s not yet ready for a dinner party, but it’s perfect for experimentation in your kitchen!

Troubleshooting Issues

If you encounter problems while using Mako, here are some troubleshooting suggestions:

  • Missing Binaries: Ensure that you have executed the build commands properly. Check for any errors in the output of the make command.
  • Unexpected Behavior: Review the documentation for any recent changes or bugs that may have been identified with the current build.
  • Library Dependencies: Ensure that all vendor libraries are correctly installed and linked. In Mako’s case, this mainly involves lcdb.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Contributions and License

If you wish to contribute to Mako, you should be aware that by doing so, you allow your code to be distributed under the MIT license and verify that all code is your original work. For detailed legal information, please refer to the LICENSE file within the project.

Final Thoughts

Exploring Mako can offer valuable learning opportunities about low-level programming and the Bitcoin protocol itself. By understanding its architecture and features, you contribute to the broader aim of decentralization and innovation in the crypto space.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox