8 Distributed Ledger Technology
405
of the transaction. Transactions are broadcasted by a user’s node to its immediate
neighboring nodes.
The neighboring nodes validate each transaction and propagate it further along
possible pathways. All nodes of the blockchain will have this valid transaction after
some time. The neighboring nodes will block and discard transactions that are not
invalid.
After a given time period, a node will have received a number of valid
transactions. The node will then have the transactions organized in order, have them
validated and packed into a timestamped candidate block, find a nonce value to
create a hash which satisfies the difficulty level set by the blockchain, and have the
candidate block broadcasted to all other nodes in the blockchain for verification.
The nodes in the blockchain all participate in verifying the validity of the
candidate block. They make sure that the format of the block is correct. They make
sure that each transaction in the block is valid and is signed by the suitable parties.
They make sure that all hashes in the new block were computed correctly. They also
make sure that the candidate block references to the hash of an appropriate previous
block in the ledger. If the result of the verification process turns out to be positive,
every node will add the block to its own copy of the ledger. If the candidate block is
not valid, then it will be discarded. This process will repeat indefinitely as long as
the computer network is not down for any reason.
A critically important question is how a node should decide if a transaction
is valid. First of all, a node needs to ensure that the signatures (hashes) of the
sender and the receiver are valid. That is, the sender and receiver are both legitimate
registered participants of the blockchain and they do have valid “accounts” in the
blockchain. The amount to be sent should also be valid in terms of the type of
assets and minimum allowed value based on the kind of applications. A node also
must validate if the sender has sufficient unspent funds. Figure 8.8 shows how a
transaction is validated.
However, the above validation process assumes that every node can be trusted,
which is usually not the case for a public blockchain. A public blockchain usually
consists of a group of non-trusting participants. Therefore, a set of rules are required
for the nodes to agree on the validity of the transactions. Because the transactions are
assembled into blocks, blocks need to be validated after the transaction validation is
carried out. In blockchains, consensus algorithms are employed to validate blocks.
The opinion of the majority of the nodes on the blockchain will decide the validity
of the blocks.
The problem is that a bad user can create multiple participant identities via one
specific node and can therefore potentially control the entire blockchain. In order to
avoid such a problem, what Bitcoin does is making the finding of a new valid block
very computationally expensive so that a bad node is not able to beat other nodes
collectively on the blockchain because of a single node’s limited computing power.
This is the consensus mechanism called Power-of-Work. Based on this mechanism,
malicious blocks from a bad node are unlikely to be accepted because it is up to the
majority of the nodes on the blockchain to approve the validity of a candidate block.
405
of the transaction. Transactions are broadcasted by a user’s node to its immediate
neighboring nodes.
The neighboring nodes validate each transaction and propagate it further along
possible pathways. All nodes of the blockchain will have this valid transaction after
some time. The neighboring nodes will block and discard transactions that are not
invalid.
After a given time period, a node will have received a number of valid
transactions. The node will then have the transactions organized in order, have them
validated and packed into a timestamped candidate block, find a nonce value to
create a hash which satisfies the difficulty level set by the blockchain, and have the
candidate block broadcasted to all other nodes in the blockchain for verification.
The nodes in the blockchain all participate in verifying the validity of the
candidate block. They make sure that the format of the block is correct. They make
sure that each transaction in the block is valid and is signed by the suitable parties.
They make sure that all hashes in the new block were computed correctly. They also
make sure that the candidate block references to the hash of an appropriate previous
block in the ledger. If the result of the verification process turns out to be positive,
every node will add the block to its own copy of the ledger. If the candidate block is
not valid, then it will be discarded. This process will repeat indefinitely as long as
the computer network is not down for any reason.
A critically important question is how a node should decide if a transaction
is valid. First of all, a node needs to ensure that the signatures (hashes) of the
sender and the receiver are valid. That is, the sender and receiver are both legitimate
registered participants of the blockchain and they do have valid “accounts” in the
blockchain. The amount to be sent should also be valid in terms of the type of
assets and minimum allowed value based on the kind of applications. A node also
must validate if the sender has sufficient unspent funds. Figure 8.8 shows how a
transaction is validated.
However, the above validation process assumes that every node can be trusted,
which is usually not the case for a public blockchain. A public blockchain usually
consists of a group of non-trusting participants. Therefore, a set of rules are required
for the nodes to agree on the validity of the transactions. Because the transactions are
assembled into blocks, blocks need to be validated after the transaction validation is
carried out. In blockchains, consensus algorithms are employed to validate blocks.
The opinion of the majority of the nodes on the blockchain will decide the validity
of the blocks.
The problem is that a bad user can create multiple participant identities via one
specific node and can therefore potentially control the entire blockchain. In order to
avoid such a problem, what Bitcoin does is making the finding of a new valid block
very computationally expensive so that a bad node is not able to beat other nodes
collectively on the blockchain because of a single node’s limited computing power.
This is the consensus mechanism called Power-of-Work. Based on this mechanism,
malicious blocks from a bad node are unlikely to be accepted because it is up to the
majority of the nodes on the blockchain to approve the validity of a candidate block.
