needmoreeasy EN 한국어
Learn

17 — Cryptocurrency ledger — state and transactions

★★★☆☆ (3/5)cryptocurrency ledger and transactions
Prerequisites
03 — Set, 06 — If, 07 — While
You will end up with
a small cryptocurrency ledger with balances, fees, supply, and transaction nonces

Full NeedMoreCoin guide

The blockchain learning track now uses one coherent NeedMoreCoin example set instead of separate toy hash/signature programs. Six variants cover sentence, beginner, and advanced NME in Korean and English.

Start with:

nme check examples/needmorecoin-sentence.en
nme run examples/needmorecoin-sentence.en

State rules

The ledger stores balances, each address's last transaction nonce, and total supply. A transaction is applied only after its proof, positive amount, amount + fee balance requirement, and exact next nonce all validate.

The nonce prevents an already accepted signed transaction from being applied a second time. Fees move existing coins from sender to miner; mining rewards mint new coins. Therefore the validator must preserve:

sum of wallet balances = initial supply + minted mining rewards

Six variants

  • needmorecoin-sentence.ko.nme
  • needmorecoin-sentence.en.nme
  • needmorecoin-beginner.ko.nme
  • needmorecoin-beginner.en.nme
  • needmorecoin-advanced.ko.nme
  • needmorecoin-advanced.en.nme

Next, 18 — Proof of work binds this state to previous block hashes and requires real SHA-256 work before a block is accepted.

This page on GitHub