# Innovative Application of Blockchain Technology for Digital Recipe Copyright Protection
## 5 Improvement of Consensus Mechanisms and Quality Testing of Recipes
### Improved DPOS Algorithm  
In the current practical production environment for digital copyright protection, creators submit their own recipes to be stored inside the blockchain, generating a unique proof of copyright. However, the traditional DPOS has a lot of room for human manipulation in the voting process. Therefore, in response to this phenomenon, we dynamically change the rank of the node by obtaining the node's score. A node's score (\(S\)) depends on the current recipe's quality. The quality of a recipes is determined by three factors, namely logic (\(L\)), detail (\(D\)), and completeness (\(C\)). \(\alpha\)\(\beta\) and \(\gamma\) are parameter weights of 0 to 1. The formula is as follows:  
\[S=(\alpha*L+\beta*D+\gamma*C) \tag{2}\]  
In this way, the quality of user recipes can be improved, and human influence in the traditional DPOS voting process can be avoided. In the DPOS consensus mechanism, there are certain kinds of malicious behaviors, such as bribery, whereby certain nodes that want to become validators unite with other voting nodes to increase their probability of becoming validator nodes. In the improved DPOS consensus mechanism, nodes with high data quality are classified as validator nodes, and nodes with low data quality are classified as ordinary nodes, which avoids this phenomenon to a certain extent, and ordinary nodes can improve their rank by improving the quality of their recipes so that they can become validator nodes in the next round of selection. The validator nodes are mainly responsible for creating new blocks to add to the blockchain and validating the blocks created by other nodes. However, in the current environment, malicious nodes aiming to improve their scores inevitably become validator nodes, then carry out negative behaviors [44], including the following categories:  
* Non-production of blocks: Some nodes refuse to generate blocks after they become verifier nodes, which is likely to cause delays in the network and reduce the system's operational efficiency;
* Double signatures: Supporting two different types of blockchain at the same time can lead to the generation of double payments and other problems, seriously affecting the balance of the blockchain;
* Inactivity: Validator nodes must actively participate in the network to validate transactions and generate new blocks. If a validator node is inactive for a long period, then it may be considered a malicious node by the network;
* Denial of service attacks: Validator nodes may still attempt to block the network connectivity of other nodes by sending many invalid transactions or blocks;
* Transaction censorship: Validator nodes selectively pack transactions for some reason;  
To avoid this situation, in this paper, we introduce a penalty mechanism. When different malicious behaviors occur in the validator node, we adopt the following strategy. * Validator nodes that produce malicious behavior cancel their scores and are treated as normal nodes;
* For nodes that have had malicious behavior to transmit data again for scoring, an exponential decay factor (\(F\)) is introduced. \[F=\exp(-kE) \tag{3}\]  
The value of \(F\) depends on the number of times the current node has acted maliciously. \(k\) represents a random coefficient. \(E\) represents the number of negative behaviors; the larger the value of \(E\), the less likely the node is to become a validation node. The specific formula is as follows:  
\[S=(\alpha*L+\beta*D+\gamma*C)\exp(-kE) \tag{4}\]  
Even if the node's \(L\), \(D\), and \(C\) scores are high, if the \(F\) score is also high (i.e., the node has exhibited multiple malicious behaviors), \(S\) is reduced. At the same time, we consider that if the node with negative behavior actively participates in the consensus and submits high-quality data later in the process, we should reduce the impact of maliciousness and ensure that the node can normally join the network after a period of positive behavior, so we add a time decay factor (\(T\)) for the node with malicious behavior.