Skip to content
origo edited this page Oct 5, 2017 · 1 revision

Welcome to the js-blockchain wiki!

Notes on hashing

Any of the supported hashing functions can be used when building a new blockchain, SHA256 is used by BitCoin, but also SHA1, or the broken MD5 are available.

Block Hash

Each block is double hashed from its header concatenated fields:

  • Version (float)
  • Id (int)
  • Timestamp (ISODateString)
  • TransactionsHash (String - concatenated Transaction hashes)
  • PreviousHash (String - hex hash of previous block)
  • CoinBase1 (String - hex hash)
  • Nonce (hex string)

Transaction Hash

Each transaction is hashed from its concatenated fields:

  • Id (int - increases within block)
  • Sender (String - wallet address)
  • Receiver (String - wallet address)
  • Amount (float)
  • Timestamp (ISODateString)

TODO: Merkle Root hash for transactions, or work is not the same for all blocks.

Clone this wiki locally