Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
github.com/yiqing2018/minicryptocurrency
This is a course project of CS425 in UIUC.
Some basice functions within cryptocurrency system are implemented, including Gossip Protocol, transaction verification, Nakamoto consensus with longest chain rule
step 1. running Introduction Service
$python3.6 mp2_service.py <port> <tx_rate>
step 2. initialize new nodes and join the money talk!
$go build ./
$./helper.sh
step 3. Kill half nodes (optional)
$ cd [IntroductionService]
$thanos
step 4. shut down IntroductionService, terminated all nodes, check log files!
$ cd [IntroductionService]
$ QUIT/DIE
messages over the network follow this format:
"TRANSACTION [timestamp] [transactionID] [source account] [destination account] [transaction amount]"
message over the network follow this format:
"neighbour [ipAddr] [nodeName] [listenPort]"
code structure:
type NeighborInfo struct {
ipAddr string
nodeName string
listenPort string
}
"block [Serialized string with Base64]"
code structure:
type Block struct {
PreviousHash string
Index int
Timestamp string
BlockTransMap map[string]TransRecord
BalanceMap map[int]int
Puzzle string
Solution string
}
push the newest transaction to its random neighbors
When received new transactions from Introduction Service, the node will forward this transaction to its neighbors randomly, which can guarantee that the transaction from Introduction Service will not be lost when this node is not the neighbor of any other nodes.
pull history transaction list from its random neighbors
the node will send "transaction request" to its neighbors randomly in order to "merge" the transaction list with the transactions from other nodes.
This operation can guarantee that each node will update its transaction list at a quick rate.
pull the neighbor(s) from Introduction Service
the newly joined node will get the introduced neighbors from IntroductionService after send CONNECT message.
periodically pull neighbor for neighbour’s neighbours
pull the neighbor list from its random neighbors and merge with original neighbor list, and also the node could take adavantage of transaction broadcast, we can receive transaction information along with neighbour address!
Whenever receiving a QUIT/DIE message from IntroductionService, the receiver would quit all processes and die immediately. If IntroductionService fails, all nodes will continue broadcasting message to other nodes for a limited time(hard coded in our project)
You may NEED modify some paramters based on the number of the nodes For example, when a node tries to pull neighbor list, how many times for sending request to others? 15 rounds for 100 nodes might be ideal.
Note: this part of work is done by Introduction Service, we only need to send the SHA256 hash of the block and get new puzzle; request a puzzle solution from the service by issuing a SOLVE command
Using nTree structure to preserve longest chain rule.
Once the node is verified, add the node into tree structure, and find out the longest chain, generate a new block based on the end of longest chain.
Because we keep parent reference within in a block, it is easy to track all transactions within any chain. Once we know which transactions are maintained in the chain, it is convenient to generate a new block based on new transactions.
This figure show how many transactions every node eventually received. The blue points represent the nodes which were killed on the half way; the red points represent the alive nodes after Thanos. It is obvious that 100 nodes were reached before Thanos, and 50 nodes were reached after Thanos.
Figure1 shows the propagation time of every block. All blocks are propagated within 200ms. Figure2 shows the number of received blocks for every node. Most nodes receive about 90 blocks.
According to our experiment, there is only 1 split
How long does each transaction take to appear in a block?
You MAY want to explore more about this implementation... go check the log files OR generate your own logs!
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.