CPC H04L 9/3239 (2013.01) [G06F 16/2379 (2019.01); G06Q 20/3674 (2013.01); G06Q 20/3827 (2013.01); H04L 9/12 (2013.01); H04L 9/3297 (2013.01); H04L 63/123 (2013.01); H04L 67/10 (2013.01); G06Q 2220/00 (2013.01); H04L 9/50 (2022.05)] | 14 Claims |
1. A method comprising:
updating, by a network node of a plurality of distributed network nodes via network gossiping, a peers queue containing descriptors of a random subset of peer nodes selected from connected peer nodes;
receiving, by the network node, transaction information from a first peer node in the random subset of peer nodes;
appending, by the network node, a transaction descriptor for a transaction associated with the transaction information to an unconfirmed transactions queue;
transmitting, by the network node, the transaction descriptor in the unconfirmed transactions queue to a second peer node in the random subset of peer nodes;
generating, by the network node, a transaction ballot containing a first subset of transaction descriptors in the unconfirmed transactions queue, wherein the first subset of the transaction descriptors is based upon block size of a blockchain;
receiving, by the network node, a second subset of transaction descriptors from a third peer node in the random subset of peer nodes;
updating, by the network node, the transaction ballot by appending one or more transaction descriptors from the first set of transactions, wherein the one or more transaction descriptors are not present in the transaction ballot;
transmitting, by the network node, an updated transaction ballot to a fourth node in the random subset of peer nodes;
generating, by the network node, a proposed next block to be appended to the blockchain and containing the transaction descriptors in the updated transaction ballot;
determining majority consensus of a plurality of nodes regarding a block to be appended to the blockchain by:
generating, by the network node, a first hash of the proposed next block to be appended to the blockchain by the network node;
appending, by the network node, the first hash to a hash votes queue;
receiving, by the network node, from a plurality of the connected peer nodes a plurality of hashes of respective proposed next blocks to be appended to the blockchain generated by the plurality of connected peer nodes;
determining, by the network node, which of the received hashes belongs to a majority of received hashes;
determining, by the network node, whether the first hash is the same as the received hashes that belong to the majority of received hashes;
upon determining by the network node that the first hash belongs to the majority of received hashes:
appending, by the network node, the proposed next block to a local copy of the blockchain;
upon determining by the network node that the first hash does not belong to a majority of received hashes:
transmitting, by the network node, a block request to a peer node of the connected peers nodes that generated a hash belonging to the majority of received hashes;
receiving, by the network node, a block corresponding to the majority of hashes from the peer node;
appending, by the network node, the block corresponding to the majority of hashes from the peer node to the local copy of the blockchain;
upon determining by the network node that the transaction information from the first peer node is invalid:
appending, by the network node, a descriptor of the first peer node into a suspected nodes queue; and
updating, by the network node, the suspected nodes queue in response to determining that a predetermined number of epochs have passed.
|