Live data from Hacker News

Show HN: Mako – a full Bitcoin implementation in C

github.com

31–40 of 129 posts

Re: Show HN: Mako – a full Bitcoin implementation in C

#32
post #9

This is very impressive, but I’ll be honest, I wouldn’t want to expose any new software written in C to the internet.

Can I ask you why? I mean, I know about memory safety and stuff, but it is that bad?

Independent researches (Microsoft/Mozilla) showed that around 70% of security vulnerabilities are caused by memory safety bugs. That's one heck of a "memory safety and stuff" :)

Here's one reference: https://msrc-blog.microsoft.com/2019/07/18/we-need-a-safer-s...

Re: Show HN: Mako – a full Bitcoin implementation in C

#33

Not to belittle the work, but it is always prudent to research what the other implementations are before possibly doing duplicate work and providing that comparison along with the new work for justification of it. For example, https://en.bitcoin.it/wiki/Software#C shows picocoin (libccoin), which Github also lists as being C. What makes this or what is desired to for this to be different from the alternative(s)? It c…

Right. Perhaps I should explain this in the readme.

To be clear:

Libbtc is a small bitcoin library meant for everyday things: signing transactions, maintaining an SPV wallet, etc. It's good at what it does, but you wouldn't be able to actually sync and validate an entire blockchain with it.

I suppose picocoin is the most similar to mako, but I think it falls short of being a "full node" in that it doesn't provide a mempool, miner, or RPC (from what I can tell). I'm also not clear on how it is storing UTXOs. It looks incomplete right now, but maybe jgarzik could give more insight on that.

Mako is a _full_ reimplementation of bitcoin. It's an alternative to bitcoin core.

Re: Show HN: Mako – a full Bitcoin implementation in C

#34

Anything interesting on your choice of project name?

Its placeholder name was originally "libsatoshi", but I was worried that would cause confusion between this project and bitcoin core.

I spent the past few days thinking of names. Mako came to mind because I had recently been playing through the original FF7 (maybe the first time in ~10 years). It's short, memorable, looks cool. It checked all the boxes. On top of that, pretty much every name involving the words "btc", "coin", etc. is already taken when it comes to bitcoin projects.

That said, apparently there is a wayland notifier also named "mako", so I may have to think up a different name here. =/

Re: Show HN: Mako – a full Bitcoin implementation in C

#35
post #22
post #17

Earlier quoted context omitted.

Thanks. This was definitely the hardest project I've worked on in my life. I fear I may have shaved a few years off my life with all of the all-nighters I pulled with this, so it's good to hear recognition for the work. :)

Very impressive work. Was there a deadline that you were trying to meet? What was the reason for the all-nighters?

No deadline. I just have a tendency towards obsession when I'm working on a project I'm very interested in. I tend to get into a kind of manic phase where I can't sleep even if I wanted to. There's no real telling when that phase will end. So I end up coding for an unhealthy amount of time. I don't recommend it to anyone.

Re: Show HN: Mako – a full Bitcoin implementation in C

#36
post #22
post #17

Earlier quoted context omitted.

Thanks. This was definitely the hardest project I've worked on in my life. I fear I may have shaved a few years off my life with all of the all-nighters I pulled with this, so it's good to hear recognition for the work. :)

Very impressive work. Was there a deadline that you were trying to meet? What was the reason for the all-nighters?

When you really love working on something, sometimes you just can't sleep.

It's the most productive you can ever be imho.

Re: Show HN: Mako – a full Bitcoin implementation in C

#39
post #24

This look cool! great job, congrats. What are you using as data storage? I understand btcd uses leveldb, are you using something similar?

I considered using leveldb initially, but that would require a C++ compiler and it also requires linking to libstdc++. So at that point, you might as well just write the project in C++, which defeats the point of this project.

Mako uses LMDB. Aside from Berkeley DB, it's pretty much the only key-value store in town if you want a pure C project.

In the end, it worked out well because I really like LMDB. It has a very intuitive API, and it's very small, which sort of matches the spirit of this project.

The zero-copy on reads feature is also amazing. When reading a UTXO from the database, we do no copying and no allocation whatsoever. The UTXO is simply parsed from the pointer LMDB returns. This is something LevelDB cannot do at all.

Re: Show HN: Mako – a full Bitcoin implementation in C

#40
post #30

Can't help but shake my head over this incredibly impressive waste of time.

Hacker news values intellectual curiosity, so why dismissing something so interesting as a waste of time?

Moreover, the code is beautifully written, the project is useful and the rules of HN ask you not to dismiss project just the way you did.

Post reply on HN