Skip to content

Instantly share code, notes, and snippets.

@rpip
Created April 7, 2020 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpip/7daf50c0fecfa1f8b4a7733a8239a82a to your computer and use it in GitHub Desktop.
Save rpip/7daf50c0fecfa1f8b4a7733a8239a82a to your computer and use it in GitHub Desktop.

Blockchain 101

Transactions are bundled into a Block. Blocks are then chained together into a "blockchain".

The way the chain of transactions and linked blocks are verified is what we call consensus algorithms. The consensus algorithm varies based on the incentives for the network operators/participants: Proof of Work, Proof of Stake etc.

Not every transaction has a recipient; in this case, this is a smart contract, which is basically a script deployed on the blockchain. In most cases, every blockchain transaction is a script but the execution/decryption of this script is tied to someone (recipient's) secret key. So for smart contracts, usually there is no recipient.

If you're not familiar with blockchains, I would advise that you don't dig into the technical implementation as it's quite complicated. Think of the datasets as regular databases tables connected by primary keys (in this case, fields). Focus on high-level constructs as below:

Transactions / Blocks

Periodically wraps up transactions as a block (similar to a page in a paper ledger)

  • Each block depends on the previous block making a chain from the origin
  • To edit a transaction in a block would require recalculation of all blocks after it
  • Normally uses a distributed ledger with a consensus system and public/private key cryptography

Consensus

Prevents “double-spend” or validation of fraudulent transactions through:

  • Proof of work: miners compete to validate blocks by solving highly processor / RAM intensive cryptographic problems for rewards
  • Distributed Consensus: majority validation by trusted subnetworks of peer nodes within the network.
  • Proof of Stake: achieves distributed consensus by network users proving their ownership of the currency

more on this here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment