A blockchain in 200 lines of code
medium.com
medium.com
- Proof-of-Work, which effectively functions as a leader election algorithm
- Consensus programs, which mediate any changes to the blockchain.
Each Bitcoin transaction has an associated script that determines how it can be spent. A conforming block satisfies all of the scripts for all of the transactions being spent.This particular post illustrates something which I would say is little more than a Merkle tree[1], except it isn't even that. But perhaps it's illustrative for some people.
However, as other people have pointed out, this implementation is so incorrect that it fails to even do that: it contains only the hash of the previous data, not the hash of the previous node, so this actually only manages to verify the previous one entry of the chain :/. This is essentially just a linked list :(.
Obviously no one uses the kernel series to store arbitrary data on behalf of the patch submitters. But you could, without modification to the software or processes.
We can always torture the concrete into extended metaphor. It just doesn't add any value here.
HASH(prevheader) == blockheader.prevHash
This one actually adds a blockheader.hash field and instead compares prevheader.hash == blockheader.prevHash
Naive indeed:-)If your custom blockchain has a static target, choosing the best chain by height is perfectly fine. Though, I'm not sure how useful a blockchain without retargetting or POW would be.
Blockchains are just linked lists; without proof-of-work its useless.
Other than having utterly illogical scoping. Which is the entire reason 'let' was introduced and should always be preferred.
It's inconsistent with other languages which introduce a new scope whenever there are curly braces, but there's nothing inconsistent about the syntax. That's just a matter of taking expectations from other languages and expecting them to work unchanged in JavaScript.
Can you imagine how cool it would be if a million or, say, a hundred million people joined forces to do what a $60 mobile phone can do?
This is absolutely the future. No doubt about it. No one can ever conceivably come up with a paradigm as cool as this level of redundancy. And on top of all of this, it even works. (Not as designed, because 51% of miners may be controlled by one entity, but in practice it totally works.)
"Ethereum is an open-source, public, blockchain-based distributed computing platform featuring smart contract (scripting) functionality. It provides a decentralized virtual machine, the Ethereum Virtual Machine (EVM). This virtual machine can execute Turing-complete scripts using an international network of public nodes and a token called ether. Gas, an internal transaction pricing mechanism, is used to prevent spam on the network and allocate resources proportionally to the incentive offered by the request"
Unrelated, I remember an experiment on Twitch, where hundreds of viewers controlled/played Pokémon Yellow (Gameboy emulator) live on Twitch via chat commands like "left", "right". It more or less worked out fine, but was rather slow progress.
These days, I think the hardware investment is much lower than the software+infrastructure+social investment of running your experiment on BOINC.