liveBook · Manning

Cryptocurrency

As explained in The Joy of JavaScript

A digital currency that uses cryptographic techniques to secure transactions and control the creation of new units.

Cryptocurrency is digital currency secured through cryptography, with transactions and new units managed by a blockchain-based protocol. A blockchain records immutable blocks linked by hashes. section 1.6

A small cryptocurrency protocol makes several mechanisms concrete:

  • Immutability prevents changing existing blocks; new records are appended instead. section 1.6
  • Hashing links each block to its predecessor and exposes changes to the chain. section 1.6
  • Mining and proof of work help validate pending transactions before they enter the chain. section 1.6

A wallet payment

Luke pays Ana’s coffee shop with a digital wallet. The transaction becomes pending, miners compete to validate it, and the completed transaction joins other transactions in a new block. section 1.6

Figure 1.13 A simple representation of a blockchain, in which each block stores the previous block’s hash. This hash is used to compute the current block’s own hash, effectively connecting all these blocks in a chain.

Trace how each block stores the previous block’s hash and uses it to compute its own chain link. section 1.6

How The Joy of JavaScript covers it

How deep it goes
Explains transactions, immutability, hashing, mining, and proof of work, while stopping short of production-ready implementation.
Examples
Demonstrates Luke’s coffee payment from a digital wallet through pending validation and block inclusion.
What it assumes
Assumes JavaScript background while requiring no prior blockchain knowledge.
What you can do after
Build a naive blockchain protocol from scratch using modern JavaScript techniques.
How it connects
Links cryptocurrency to blockchain, digital wallets, transactions, hashing, mining, immutability, and proof of work.

Also explained in

Compare how 2 books explain cryptocurrency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Joy of JavaScript. The section links point to the parts of the book it draws on.