Live data from Hacker News

Show HN: Mako – a full Bitcoin implementation in C

github.com

81–90 of 129 posts

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

#81
Call me old school, but I like looking at the number of lines of code to get a feel for how big of a project something is. Mako[1] is 265,618 lines of code. The most widely accepted Bitcoin implementation[2] is 639,074 lines of code -- that's 2.5x bigger and written in a slew of languages. Mako looks like a super-impressive amount of work (and by a single person no less).

[1] https://github.com/chjj/mako

[2] https://github.com/bitcoin/bitcoin

[3] How I calculated: find -type f | sed 's/.*/"&"/' | xargs wc -l

EDIT: Also of interest is this "from-scratch tour of Bitcoin in Python" that was discussed here on HN a few months ago: https://news.ycombinator.com/item?id=27593772

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

#82
I've been writing C for two decades.

But in recent years I have used Go as a replacement for C whenever possible. I think of Go as an improved C, with slightly different performance characteristics.

In your opinion, what is the advantage of writing a program like Mako in C rather than Go?

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

#83

Call me old school, but I like looking at the number of lines of code to get a feel for how big of a project something is. Mako[1] is 265,618 lines of code. The most widely accepted Bitcoin implementation[2] is 639,074 lines of code -- that's 2.5x bigger and written in a slew of languages. Mako looks like a super-impressive amount of work (and by a single person no less). [1] https://github.com/chjj/mako [2] https://…

Thx for [3]. I usually just do

    wc -l *.c */*.c */*/*.c */*/*/*.c */*/*/*/*.c */*/*/*/*/*.c */*/*/*/*/*/*.c

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

#84

Call me old school, but I like looking at the number of lines of code to get a feel for how big of a project something is. Mako[1] is 265,618 lines of code. The most widely accepted Bitcoin implementation[2] is 639,074 lines of code -- that's 2.5x bigger and written in a slew of languages. Mako looks like a super-impressive amount of work (and by a single person no less). [1] https://github.com/chjj/mako [2] https://…

Thx for [3]. I usually just do wc -l *.c */*.c */*/*.c */*/*/*.c */*/*/*/*.c */*/*/*/*/*.c */*/*/*/*/*/*.c

In bash/zsh and many other shells '*/*.c' would be similar.

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

#85

Call me old school, but I like looking at the number of lines of code to get a feel for how big of a project something is. Mako[1] is 265,618 lines of code. The most widely accepted Bitcoin implementation[2] is 639,074 lines of code -- that's 2.5x bigger and written in a slew of languages. Mako looks like a super-impressive amount of work (and by a single person no less). [1] https://github.com/chjj/mako [2] https://…

https://github.com/boyter/scc

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

#86

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…

In my opinion, given the application is cryptocurrency, reimplementations are pretty valuable. It’s important to avoid systemic failure due to a large percentage of nodes having the same exploit or bug. A fully featured reimplementation like this is really great for Bitcoin!

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

#87
post #17
post #8

This looks like a herculean effort over just the past few months. Congratulations on hitting this milestone and hopefully you can take a breather and tie up loose ends at a more comfortable pace. As much as HN has changed over the years I still think this is a place where there are a lot of people who can appreciate how you feel right now. Nicely done!

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. :)

Truly an amazing output! Did you really do all this in 2.5 months? Seems I need to dramatically up my coding game!

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

#88

I've been writing C for two decades. But in recent years I have used Go as a replacement for C whenever possible. I think of Go as an improved C, with slightly different performance characteristics. In your opinion, what is the advantage of writing a program like Mako in C rather than Go?

btcd is an existing implementation in go https://github.com/btcsuite/btcd

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

#89
post #67
post #39

Earlier quoted context omitted.

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…

There's always SQLite, which can also be used as a key-value store.

And is similarly pure c, self contained

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

#90

Earlier quoted context omitted.

Your english language description of it gives some good clues to the alternative: int btc_tx_import(btc_tx_t *transaction, const uint8_t *raw_transaction, size_t raw_transaction_size); Or since clearly `tx` is already a convention for "transaction", it could be `tx`, `raw_tx`, and `raw_tx_size`. And sure, I have no problem with the `p` and `n` stuff, so it could be `txp`, `raw_txp`, `raw_txn`. But from your descripti…

Pythonic

Self documenting code is good in every language.
Post reply on HN