Starting Zig Bitcoin Community effort: https://github.com/zig-bitcoin
Zig language is still very much underrated IMO.
One thing that is awesome is the way you can use it progressively:
- First as a toolchain. You can replace a complex build system for your C/C++ with a simple build.zig that gives you easy portability and other great things.
- Then, you can seamlessly build new parts of your projects in Zig, and connect it natively with the rest of your codebase. So you don't have to engage in a big and complex migration.
I love how Zig is (similar to Go) idiomatic by default. Don't forget the fact that we read code more than 10x more than we write code. So the ability to read and understand code is extremely important.
Put it simply, in Rust, for one problem / thing, depending on the Rust dev who will work on it, you can have a lot of different possibilities / style / practices to solve it.
On Zig, this is drastically reduced, usually there is one obvious way to do one thing. Rust is getting more and more complex, and there are so many ways of doing the same thing.
So even Rust senior devs can be lost when working on a new code base.
I like the simplicity of Zig, communicate intent precisely, no macro and magic code.
Zig has to catchup the Rust ecosystem in terms of tooling and libraries but clearly this language has a very strong potential.
Those are some reasons why I want to start a Bitcoin Zig Community initiative. The goal is to build primitives, libraries and tooling in Zig for Bitcoin ecosystem.
It can be great educational content and way to onboard to Bitcoin ecosystem as a developer.
Also, it can help increase diversity of implementations. For instance, similarly to what Roasbeef is doing with btcd, which I think is great.
We start by those projects:
- bitcoin-zig: Core Bitcoin primitives implemented in Zig, including base58, bech32, and more.
- btczee: A full Bitcoin protocol implementation in Zig, including a node, wallet, and miner.
- coconut: A Cashu wallet and mint implementation in Zig
- libsecp256k1-zig: Zig bindings for the libsecp256k1 library, essential for Bitcoin cryptography.
So if you are a developer and you like Bitcoin and you are fan of Zig (or you don't know it yet), come and contribute to this open source initiative.