Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

A Blockchain is a distributed database secured by cryptography, used to maintain a continuously growing list of records, called blocks. Its applications include Bitcoin and Ethereum, but also a lot more than just cryptocurrency.

A blockchain has a list of blocks. A blockchain always starts with one block, called the genesis block.

The index is the position of the block in the chain. The genesis block has an index of 0. The next block will have an index of 1.

A record of when the block was mined. The recorded timestamp on this block is 1502208000, which translates to 16:00:00 GMT 08/08/2017

A hash looks like a bunch of random numbers. It is a digital fingerprint of the information contained on the block. A valid hash has four leading zeros.

The hash is generated by a cryptographic function called SHA256. The function has the following input variables: block index (0), previous hash (0), data (Welcome to the blockchain!), timestamp (1502208000), and nonce (77177).

f( index + previous hash + data + timestamp + nonce ) = hash

If any of the input variables change, a new and unique hash will be generated.

The previous hash is the hash on the previous block. Because the genesis block is the first block, it has a previous hash of 0.

The data held on the block. In Bitcoin for example, the data would be money transactions.

Since data is an input variable for the hash, changing the data will change the hash.

Changing the hash will generate a new hash without four leading zeros, and the block becomes invalid.

A valid block in this blockchain has a hash with four leading zeros. The number of leading zeros infront of the hash is called difficulty.

When data changes, the hashing function generates a hash without four leading zeros, making the block invalid.

Because the hashing function takes the previous hash as input, every subsequent block becomes invalid. Therefore, a blockchain is resistant to change.

Mining is the process of finding a valid hash.

The nonce is the number used to find a valid hash.

The nonce is the independent variable in the hash function that increases from 0 until a valid hash is found.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors