Live data from Hacker News

Show HN: Mako – a full Bitcoin implementation in C

github.com

51–60 of 129 posts

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

#52
post #49
post #34

Earlier quoted context omitted.

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"…

Mako was the thing that Shinra almost destroyed the planet trying to extract, so you may end up opening the project up to a lot of Barret+Bitcoin memes. That could be a win!

Not to get in a pedantic FF7 debate, but I don't believe Mako was destroying the planet: Shinra's Mako reactors were destroying the planet. Mako energy was a tool, and it could be used for good or evil, just like cryptocurrency. In the case of bitcoin, I believe it is being used for good.

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

#53
post #50

can something like this actually participate in the real bitcoin network or does everyone have to run the same client?

Bitcoin is a protocol much in the same way HTTP is - so just like there are multiple implementations of web browsers, there are also multiple bitcoin implementations. This is the first in C.

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

#54
post #52
post #49

Earlier quoted context omitted.

Mako was the thing that Shinra almost destroyed the planet trying to extract, so you may end up opening the project up to a lot of Barret+Bitcoin memes. That could be a win!

Not to get in a pedantic FF7 debate, but I don't believe Mako was destroying the planet: Shinra's Mako reactors were destroying the planet. Mako energy was a tool, and it could be used for good or evil, just like cryptocurrency. In the case of bitcoin, I believe it is being used for good.

I don't mind pedantic FF7 debates! I think Mako was Shinra's branding on the energy they obtained by mining the Lifestream via the Mako reactors; I don't think it was some natural force.

Edit: Hmmm.

"Mako (Japanese: 魔晄, Makō; literally meaning "magic light") is a liquid substance featured throughout Final Fantasy VII. It is the condensed form of lifestream and the primary source of energy used by human beings throughout the world. It is comparable to nuclear energy. Lifestream can condense into Mako via both natural and artificial processes. The terms "Mako" and "Lifestream" are often used interchangeably because one is a derivative of the other."

From here: https://finalfantasywiki.com/wiki/Mako

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

#55

Cool to study. Disappointed there are zero comments and the most terse variable names as possible. Almost like it was js-minified.

Some of the terse variable names are the result of my adherence to a GMP-like naming convention, which I find easy to read and aesthetically pleasing.

The GMP naming convention is something like:

- Pointer/Data - single letter followed by a "p"

- Size/Length - single letter followed by an "n"

So a function declaration might look like:

    static void
    process_bytes(uint8_t *zp, const uint8_t *xp, size_t xn);
The above function would do some processing on `xn` bytes at `xp` and store the result in `zp` (assuming there are `xn` bytes also allocated here).

A function which accepts more inputs might have `yp` and `yn` also, so conceptually: `zp = func(xp, xn, yp, yn);` or to simplify: `z = func(x, y)`.

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

#56
post #55

Cool to study. Disappointed there are zero comments and the most terse variable names as possible. Almost like it was js-minified.

Some of the terse variable names are the result of my adherence to a GMP-like naming convention, which I find easy to read and aesthetically pleasing. The GMP naming convention is something like: - Pointer/Data - single letter followed by a "p" - Size/Length - single letter followed by an "n" So a function declaration might look like: static void process_bytes(uint8_t *zp, const uint8_t *xp, size_t xn); The above fun…

This is a bad convention. Instead of `x` and `z`, you should describe what those pointers are meant to represent. I get that everything is subjective, but some things are actually just bad due to illegibility, and I think it is worth being frank about this.

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

#57
post #42
post #5

Earlier quoted context omitted.

Do you mind elaborating? I obsess over clean code, so any criticism is appreciated.

I wasn't originally going to look at it but this claim got me intrigued. I'd say compared to a lot of C code I've seen, yeah, you aren't lying, the average cleanliness is so clean it's sick ;) Well done! Perhaps the GP means the general crypto nature of the project lends to opaqueness. For example, I randomly clicked into https://github.com/chjj/mako/blob/master/src/crypto/chacha20... and one could ask where the magi…

The numbers instantly say to me, "we are is lower case ASCII" due to the 0x6N and 0x7N values.

One way to do this, however is:

  #define FOURCC(a, b, c, d) ... insert shifting-oring expression here ...
Then:

  ctx->state[0] = FOURCC('a', 'p', 'x', 'e');
That doesn't tell you where those characters came from but at least unmasks the ASCII connection.

However, the code now breaks on EBCDIC compilers, where 'a' won't have the value 0x61.

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

#58
post #54
post #52

Earlier quoted context omitted.

Not to get in a pedantic FF7 debate, but I don't believe Mako was destroying the planet: Shinra's Mako reactors were destroying the planet. Mako energy was a tool, and it could be used for good or evil, just like cryptocurrency. In the case of bitcoin, I believe it is being used for good.

I don't mind pedantic FF7 debates! I think Mako was Shinra's branding on the energy they obtained by mining the Lifestream via the Mako reactors; I don't think it was some natural force. Edit: Hmmm. "Mako (Japanese: 魔晄, Makō; literally meaning "magic light") is a liquid substance featured throughout Final Fantasy VII. It is the condensed form of lifestream and the primary source of energy used by human beings through…

Hmm, not sure. I'd have to read up on the lore more, or maybe pay more attention to the game.

The thing that catches my eye there is that they say lifestream can condense into mako through natural processes as well as artificial ones.

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

#60

Earlier quoted context omitted.

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

"memory safety bugs" sounds pretty broad. What sort of vulnerability doesn't involve memory access?
Post reply on HN