Homework on Blockchain and Mining Visually - Questions

  1. Why is it important that the blocks are cryptographically linked together?
    To ensure the security of the blockchain, if anything is changed in one of the blocks, this will in turn mean that every block after it would need to also be re-mined which would be very expensive.

2.What does the block structure look like in bitcoin?
Block number, nonce, data ( transactions), previous block hash, current hash.

1 Like
  • The linking of blocks with SHA256 allows for real time error checking of the entire network. Not only is re-mining a block a costly and difficult affair, it also notifies the nodes of a change based on the change in that blocks Hashed output. If now no longer matches what the Nodes have recorded for the other concurrent blocks. This mechanism provides provenance of the ledger and ultimately the most important thing for any network, trust.

  • The block structure is Input Hash from previous block, the TX (Transaction Information that was pulled from the Mempool that will act as the next block of transactions) and a random Nonce # that must be guessed in order to solve the puzzle. This once guessed outputs another Hash that represents a new input Hash to the soon to be added block.

2 Likes
  1. Why is it important that the blocks are cryptographically linked together?
    It is important for security reasons, if you change any data in one block all blocks in the blockchain will be effekted thier by invalid.
  2. What does the block structure look like in bitcoin?
    The block contains transactions a previous hash from the blockchain (that are all linked with eachother) and nonce (a randomized nrumber ). They are later combined and targeted for the new hash.
1 Like
  1. The fact that blocks are cryptographically linked linked together provides security to the network. Even slightly altering a previous block would mean re-mining the next blocks, in essentially a race with all the other miners to achieve the longest chain, means that this would be close to impossible (or Very Expensive) to achieve.

  2. A block contains:

  • Previous Block Hash
  • TX List
  • Nonce (randomly ‘guessed’ number)
    All of which are hashed to meet a target value, which is then the hash of the following block
1 Like
  1. Why is it important that the blocks are cryptographically linked together?

Blocks must be linked together cryptographically in the blockchain to create its property of immutability. If each block was a standalone database it would be very easy to address one for alteration - reversing a transaction or unleashing a double-spend attack. The cryptographic link ensures that one block cannot be altered without changing the entire chain costing a great deal of energy.

  1. What does the block structure look like in bitcoin?

Blocks on the bitcoin network consist of five simple data fields: the block number, the nonce used to validate the block, the transaction data collected from the mempool, the hash of the previous block and the blocks own hash (created using the tx data, previous hash and nonce).
The first transaction in the transaction data field will send the block reward to the miner’s address. A miner will continuously add other transactions from the mempool to supplement their reward with transaction fees whilst they’re guessing the nonce to make the block valid.
The block will only be accepted by the network once submitted if it is the first block to have a hash within the difficulty target after the latest previous block.

1 Like

Miners keep guessing a random nonce that produce a blockhash lower than the target.

So not the nonce should be lower than the difficulty target, but the entire blockhash with the nonce included.
Because Sha256 hashes are so random, and your block needs to start with a bunch of leading zero’s, you just need to add some random number, hash it and check if the hash is low enough. This is very hard.
You can simulate mining in this website:
https://andersbrownworth.com/blockchain/blockchain

Block structure

Field Description Size
Magic no value always 0xD9B4BEF9 4 bytes
Blocksize number of bytes following up to end of block 4 bytes
Blockheader consists of 6 items 80 bytes
Transaction counter positive integer VI = VarInt 1 - 9 bytes
transactions the (non empty) list of transactions -many transactions

BLOCKHEADER :

Version Block version number You upgrade the software and it specifies a new version 4
hashPrevBlock 256-bit hash of the previous block header A new block comes in 32
hashMerkleRoot 256-bit hash based on all of the transactions in the block A transaction is accepted 32
Time Current block timestamp as seconds since 1970-01-01T00:00 UTC Every few seconds 4
Bits Current target in compact format The difficulty is adjusted 4
Nonce 32-bit number (starts at 0) A hash is tried (increments) 4

Description

Each block contains, among other things, the current time, a record of some or all recent transactions, and a reference to the block that came immediately before it. It also contains an answer to a difficult-to-solve mathematical puzzle - the answer to which is unique to each block. New blocks cannot be submitted to the network without the correct answer - the process of “mining” is essentially the process of competing to be the next to find the answer that “solves” the current block. The mathematical problem in each block is extremely difficult to solve, but once a valid solution is found, it is very easy for the rest of the network to confirm that the solution is correct. There are multiple valid solutions for any given block - only one of the solutions needs to be found for the block to be solved.

Because there is a reward of brand new bitcoins for solving each block, every block also contains a record of which Bitcoin addresses or scripts are entitled to receive the reward. This record is known as a generation transaction, or a coinbase transaction, and is always the first transaction appearing in every block. The number of Bitcoins generated per block starts at 50 and is halved every 210,000 blocks (about four years).

Bitcoin transactions are broadcast to the network by the sender, and all peers trying to solve blocks collect the transaction records and add them to the block they are working to solve. Miners get incentive to include transactions in their blocks because of attached transaction fees.

The difficulty of the mathematical problem is automatically adjusted by the network, such that it targets a goal of solving an average of 6 blocks per hour. Every 2016 blocks (solved in about two weeks), all Bitcoin clients compare the actual number created with this goal and modify the target by the percentage that it varied. The network comes to a consensus and automatically increases (or decreases) the difficulty of generating blocks.

Because each block contains a reference to the prior block, the collection of all blocks in existence can be said to form a chain. However, it’s possible for the chain to have temporary splits - for example, if two miners arrive at two different valid solutions for the same block at the same time, unbeknownst to one another. The peer-to-peer network is designed to resolve these splits within a short period of time, so that only one branch of the chain survives.

The client accepts the ‘longest’ chain of blocks as valid. The ‘length’ of the entire block chain refers to the chain with the most combined difficulty, not the one with the most blocks. This prevents someone from forking the chain and creating a large number of low-difficulty blocks, and having it accepted by the network as ‘longest’.

https://en.bitcoin.it/wiki/Block

2 Likes
  1. Why is it important that the blocks are cryptographically linked together?
    Makes it extremely difficult to “hack” the network, and to modify previously mined blocks. All following links will be broken.
  2. What does the block structure look like in bitcoin?
    Each new block is made up by the Hash of previous block + current Nonce + TX’s which results in a new output Hash. The first block in the chain has empty field as input on Prev field. Each block also has an increasing block # starting with 1.
1 Like
  1. Why is it important that the blocks are cryptographically linked together?
    It is important so that they cannot be tampered with so the network is secure
  2. What does the block structure look like in bitcoin?
    **Block#, nonce, data, previous hash, hash **
1 Like

1. Why is it important that the blocks are cryptographically linked together?
Adds to security; to change a previous mined block all subsequent blocks need to be re-mined as well.

2. What does the block structure look like in bitcoin?
A Bitcoin block contains the hash of the previous block and the transactions of the current block.

1 Like
  1. Why is it important that the blocks are cryptographically linked together?
    For greater security, immutability, tracability & provence. The cryptography allows for enctypted address generated thru hashing to be unique per TX and block thereby anybody trying to change TX/block data cannot add/change unless they have encrypted address of all previous blocks.
  2. What does the block structure look like in bitcoin?
    It containes digital fingerprint of previous hash, TX list, mempool, nonced #.
1 Like
  1. to ensure that noone can alter data in the past once blocks are added to the blockchain. If someone attempted to do that they would not only alter that particular block but changes would take effect in all following blocks. The links between blocks would collapse and network would reject such an attempt.

2)the block is basically a hash of the following data put together:
hash of the previous block + hash of transactions (Merkle root) + nonce

1 Like

Homework on Blockchain and Mining Visually - Questions

  1. Why is it important that the blocks are cryptographically linked together?
  • data immutability
  1. What does the block structure look like in bitcoin?
  • current transactions, nonce, previous block hash and current hash (all that info mention is hashed).
1 Like
  1. It is important so that consensus is followed and that the network is secure and no alterations can take place.

  2. Each block of the blockchain is linked with a previous block. The hash of each block conains all transactions of the current block, the hash of the previous block and a random number called nonse.

1 Like
  1. Why is it important that the blocks are cryptographically linked together?
    This is what makes a blockchain a blockchain. The blockchain is basically linked lists with data. This data is hashed and organized. The magic is the hash pointer that connects one list(block) to the next. The hash is added to the data header of the next block. The importance of the blocks being linked is because if any change were to be attempted to any previous block the crypto hash of that block would change and result in the changing of the hash of every block after it. The data of a closed block is super secure because of this. If a change were attempted it would be rejected by the rest of the nodes as an invalid block.

  2. What does the block structure look like in bitcoin?
    The structure of the block in BTC contains three main parts.

  • The Header. This will become a hash to link to the next block being produced
  • The hash of the previous header. This is what the hash pointer is pointing to to link from the previous block.
  • The block transactions. these transactions are all hashed and organized in a way that is refered to as a Merkle Tree.
1 Like
  1. Why is it important that the blocks are cryptographically linked together?
    It is important that blocks are cryptographically linked together because the integrity of the network relies on the immutability of transactions. This is how the blockchain solves the problem of double spending.

  2. What does the block structure look like in bitcoin?
    A bitcoin block structure is made up of the block number, the nonce, the transaction data, the hash of the previous block, and the hash of the current block.

1 Like
  1. When they are cryptographically linked together, the hash of each block are related to the last block. This will allow them to have unique signature, if any of the hashes from previous block are changed, the current block become invalid and it will not match the hash with other miners or nodes.

  2. The block consists of the data transaction data, hash from previous block and a nounce that miners need to guess which is always between 0 and the target # that was regulated by difficulty.

1 Like
  1. Why is it important that the blocks are cryptographically linked together?
    It makes it almost impossible to change previous blocks

  2. What does the block structure look like in bitcoin?
    A block is structured by the transaction list in block, the hash of the previous block, and a nonce. This gives your block it’s own hash.

1 Like
  1. Why is it important that the blocks are cryptographically linked together?
    to ensure that the rules are followed.
  2. What does the block structure look like in bitcoin?
    the block is made out of the TX list, nonce and hash of prev. block.
1 Like
  1. Why is it important that the blocks are cryptographically linked together? This creates a secure network where each transaction is connected by the blockchain and data cannot be changed or duplicated.
  2. What does the block structure look like in bitcoin? Previous hash, list of transactions and the nonce
1 Like