diff --git a/docs/whitepaper/whitepaper.md b/docs/whitepaper/whitepaper.md index ba2375d..7181ea0 100644 --- a/docs/whitepaper/whitepaper.md +++ b/docs/whitepaper/whitepaper.md @@ -1,8 +1,8 @@ **Polycash: An Increased-Decentralization P2P Blockchain System** -**Asher Wrobel** +*Asher Wrobel* (asherwrobel@proton.me) -[https://github.com/Ashy5000](https://github.com/Ashy5000) +*** **Abstract** @@ -14,7 +14,7 @@ In the current day, financial institutions have largely become adopted as an int     To resolve these issues, a new consensus algorithm is needed: the APoW (Adjusted Proof of Work) algorithm. Instead of giving blockchain power directly proportional to mining power, APoW calculates block speed on a per-miner basis. It decreases target time (base 1 minute) by up to 50% for a miner with infinite mining rate, and increases target time by up to 50% for a miner with zero mining rate. This leads to an increase of decentralization in the blockchain and the network, and allows for a lower energy requirement than with a standard PoW blockchain. -    Another issue facing modern blockchains is the threat of quantum computing, specifically Shor's algorithm, which could, in theory, break the elliptic curve cryptography blockchains typically use for digital signatures. However, new alternatives have become available, such as the CRYSTALS-Dilithium family of public-key cryptography algorithms. Post-quantum public key cryptography algorithms must soon take on an important role in blockchain systems in order to future-proof their core systems. +    Another issue facing modern blockchains is the threat of quantum computing, specifically Shor's algorithm, which could, in theory, break the elliptic curve cryptography blockchains typically use for digital signatures. However, new alternatives have become available, such as the CRYSTALS-Dilithium family of public-key cryptography algorithms. Post-quantum public key cryptography algorithms must soon take on an important role in blockchain systems in order to future-proof their security guarantees. A new blockchain, Polycash, is introduced to implement solutions to these issues. It utilizes the APoW consensus algorithm, Dilithium3 quantum-resistant signatures, and a new incentives system to increase decentralization, security, and efficiency. diff --git a/node_util/verify.go b/node_util/verify.go index 5180c2d..0cf4f54 100644 --- a/node_util/verify.go +++ b/node_util/verify.go @@ -90,11 +90,8 @@ func DetectFork(block Block) bool { break } if b.PreviousBlockHash == block.PreviousBlockHash { - Warn("Block creates a fork.") - Log("The node software is designed to handle this edge case, so operations can continue as normal.", false) - Log("This is most likely a result of latency between miners. If the issue persists, the network may be under attack or a bug may be present; please open an issue on the GitHub repository.", true) - Log("The blockchain will be re-synced to stay on the longest chain.", true) - SyncBlockchain(len(Blockchain) + BlocksUntilFinality) // Wait for finality when switching chains + Log("Block creates a fork. Possible reorg necessary.", true) + SyncBlockchain(len(Blockchain) + BlocksUntilFinality) // Reorg if other chain is more than `BlocksUntilFinality` blocks longer than the current chain return true } } @@ -167,14 +164,12 @@ func VerifyBlock(block Block, blockHeight int) bool { hash := binary.BigEndian.Uint64(hashBytes[:]) // Take the last 64 bits-- we won't ever need more than 64 zeroes. isValid = hash <= MaximumUint64/block.Difficulty && isValid if DetectDuplicateBlock(hashBytes) { - return false + return false } isValid = !DetectFork(block) && isValid if len(Blockchain) > 0 && block.PreviousBlockHash != HashBlock(Blockchain[len(Blockchain)-1], len(Blockchain)-1) { - Log("Block has invalid previous block hash. Ignoring block request.", true) - Log("The block could be on a different fork.", true) - Log("The blockchain will be re-synced to stay on the longest chain.", true) - SyncBlockchain(len(Blockchain) + BlocksUntilFinality) // Wait for finality when switching chains + Log("Block has invalid previous block hash. Possible reorg is necessary.", true) + SyncBlockchain(len(Blockchain) + BlocksUntilFinality) // Reorg if other chain is more than `BlocksUntilFinality` blocks longer than the current chain isValid = false } isValid = VerifyMiner(block.Miner) && isValid