Of course there are name collisions everywhere, but, there's a metacomputing/grid computing/distributed OS thingie named "Legion" from the University of Virginia that has a bunch of papers about it in the CS literature. Oh, and we saw off the American Legion threatening to sue us by saying "We're the State of Virginia, go right ahead..."; what's your strategy? :-)
Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
11–20 of 73 posts
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#12... had this been written in a language less esoteric than Haskell, it would've been even better for the rest of us :)
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#13Earlier quoted context omitted.
Nothing. It's a minimal blockchain.
Correct, the goal for this was as minimal as possible. However, if I (or anyone wanting to contribute) can come up with a very compact way to implement that, we could definitely add it!
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#14Earlier quoted context omitted.
Nothing. It's a minimal blockchain.
Correct, the goal for this was as minimal as possible. However, if I (or anyone wanting to contribute) can come up with a very compact way to implement that, we could definitely add it!
sha256(token + data + previous hash)
i.e. (for simplicity, previous hash = "")
sha256("1" + "example" + PreviousHash) -> ee73735c2355bc4d63319a6638e356ef42d0d56746317c99f52d3e7ac71cbf52
sha256("2" + "example" + PreviousHash) -> 6236cd42286c74a1683eaf394b3b2f40a3a52479e1a3d7e732175fcdfa49b931
...
sha256("10" + "example" + PreviousHash) -> 346fea90403e733fd6e925920eb10be06171b4f77f7cc8c4ef214a12f04d79c1
And only accepting hashes as valid where the first two characters form "34". So the last example (token 10) would be valid. This requires then to do multiple hashing operations until a valid hash emerges, thus the proof of work.
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#15Earlier quoted context omitted.
Correct, the goal for this was as minimal as possible. However, if I (or anyone wanting to contribute) can come up with a very compact way to implement that, we could definitely add it!
To implement rudimentary proof of work, you could add a nonce field and then force every block hash to start with a certain number of zeroes - I'll see what I can do and submit a pull!
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#16Earlier quoted context omitted.
Correct, the goal for this was as minimal as possible. However, if I (or anyone wanting to contribute) can come up with a very compact way to implement that, we could definitely add it!
A very simple proof of work is adding a token to the data before hashing: sha256(token + data + previous hash) i.e. (for simplicity, previous hash = "") sha256("1" + "example" + PreviousHash) -> ee73735c2355bc4d63319a6638e356ef42d0d56746317c99f52d3e7ac71cbf52 sha256("2" + "example" + PreviousHash) -> 6236cd42286c74a1683eaf394b3b2f40a3a52479e1a3d7e732175fcdfa49b931 ... sha256("10" + "example" + PreviousHash) -> 346fea…
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#17* https://hackage.haskell.org/package/distributed-process-p2p
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#18... had this been written in a language less esoteric than Haskell, it would've been even better for the rest of us :)
The situation on the JVM -- where Scala, Java and Kotlin can use one another's modules -- is a positive example. Clang modules and Swift's auto-magic import of them is another.
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#19Great use of distributed-process and distributed-process-p2p! Being able to access service discovery and peer-to-peer communication as simple Haskell packages is kind of amazing. * https://hackage.haskell.org/package/distributed-process-p2p * https://hackage.haskell.org/package/distributed-process
I actually had a slightly tough time finding good examples to work off of for p2p, (the cloud haskell website had the best ones), so hopefully this code can also work as another good example for those packages. To be fair, that's really a complaint of the ecosystem as a whole, not distributed-process-* specifically.
Re: Show HN: Legion, an as-simple-as-possible blockchain server written in Haskell
#20Earlier quoted context omitted.
Correct, the goal for this was as minimal as possible. However, if I (or anyone wanting to contribute) can come up with a very compact way to implement that, we could definitely add it!
A very simple proof of work is adding a token to the data before hashing: sha256(token + data + previous hash) i.e. (for simplicity, previous hash = "") sha256("1" + "example" + PreviousHash) -> ee73735c2355bc4d63319a6638e356ef42d0d56746317c99f52d3e7ac71cbf52 sha256("2" + "example" + PreviousHash) -> 6236cd42286c74a1683eaf394b3b2f40a3a52479e1a3d7e732175fcdfa49b931 ... sha256("10" + "example" + PreviousHash) -> 346fea…
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 strings, you would either need multiple prefixes ("000", "001", "002") regexes ("00[012]"), both more hassle than a simple less-than operation.)