Live data from Hacker News

Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

github.com

61–70 of 73 posts

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#61
post #60
post #59

Can someone explain to me in short summary why blockchain without crypto currency suddenly is a thing and why anybody would want it?

ELI5: A blockchain is an »I told you so« store. Future statements/promises are linked to past ones so you can’t mess one without having to mess with all the others. It’s like a black board you can’t wipe clean again, adding more text (and space to write to) is the only thing possible. For example, you could promise to paint your house red in a blockchain. You later regret that promise and tell your friends you never…

Except without proof-of-work, rewriting all of history is trivial.

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#62
post #5
post #3

I had a brief look through, and it looks like there's no proof-of-work in the mining? What stops somebody from rewriting history and passing it off as legitimate?

Nothing. It's a minimal blockchain.

A blockchain without a consensus algorithm is just a linked list.

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#63

... had this been written in a language less esoteric than Haskell, it would've been even better for the rest of us :)

Haskell is only esoteric if you understand programming to be mutating variable contents. Once you let go of this odd way of defining program logic, Haskell is actually a much simpler way to program, since you're writing your logic directly, instead of emulating it using mutation of state.

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#64
post #60
post #59

Can someone explain to me in short summary why blockchain without crypto currency suddenly is a thing and why anybody would want it?

ELI5: A blockchain is an »I told you so« store. Future statements/promises are linked to past ones so you can’t mess one without having to mess with all the others. It’s like a black board you can’t wipe clean again, adding more text (and space to write to) is the only thing possible. For example, you could promise to paint your house red in a blockchain. You later regret that promise and tell your friends you never…

Thanks, very good explanation. So blockchain enables us to move from "our data warehouse is the single source of truth" to "our data warehouse is the single History of truth".

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#65
post #20

Earlier quoted context omitted.

Note that "the first X characters" is kind of misleading, because it is usually more fine grained. It is better (and IMHO even simpler!) to think of the hash as a large integer, not a string. Then you want that integer to be smaller than a certain value. With strings, you can only say: "00123" shall start with "00", while wih integers, you would say: 00123 shall be smaller than 300. (To be that fine grained with stri…

You can implement 0 prefix checking pretty easily in bitstrings: 0 == hash >> (hash_length - prefix_length) Or, alternatively: !(hash & prefix_mask) where `prefix_mask` is 1111..000, with `prefix_length` number of 1s. I think that working in terms of bitstrings generated by the hash gives more context to why those integers are chosen (that they represent a certain portion of the space of possible answers), but it's a…

This is still more combersome yet less precise than a straight greater-than check.

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#67

Earlier quoted context omitted.

A Literate Haskell blockchain might just be Peak HN. ( Definitely peak HN if it runs in the browser).

Is GHCJS using WASM yet, because if so...

There's a Summer of Haskell project going this year. I think it's called WebGHC?

Edit: https://webghc.github.io

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#68
post #67

Earlier quoted context omitted.

Is GHCJS using WASM yet, because if so...

There's a Summer of Haskell project going this year. I think it's called WebGHC? Edit: https://webghc.github.io

Haha, when that happens, what will it even mean anymore. What even will software be.

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#69

Earlier quoted context omitted.

I'm not familiar with Literate Haskell, what would that involve?

It's just where the majority of the file is a comment instead of a minority.

Thank you. Thank you so much.

It's an old pet peeve of mine. I cringe inside every time someone starts waxing about "writing your thoughts first, and your code only incidentally" or "it's a completely different paradigm of programming" and other such pieces of useless, discouraging new age fluff.

Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell

#70
post #60

Earlier quoted context omitted.

ELI5: A blockchain is an »I told you so« store. Future statements/promises are linked to past ones so you can’t mess one without having to mess with all the others. It’s like a black board you can’t wipe clean again, adding more text (and space to write to) is the only thing possible. For example, you could promise to paint your house red in a blockchain. You later regret that promise and tell your friends you never…

Except without proof-of-work, rewriting all of history is trivial.

A simple counter-example comes to mind: rewriting history is trivial only if you want no central authority.

Even if we lose the "decentralized consensus" aspect with no PoW, it still can be advantageous. E.g.: simply having an authoritative server always responding with the latest block hash. The server is very lightweight (as in 80s microcontroller lightweight) and it can offload the actual blockchain handling to clients.

Post reply on HN