Abstract:Currently, the application of blockchain in the supply chain is receiving increasing attention from the industry.However, due to the presence of a large number of complex transactions in the supply chain, selecting trustworthy primary nodes poses a challenge. Therefore, based on the machine learning classification algorithms and PBFT (practical Byzantine fault tolerance), this study proposes a blockchain PBFT optimization method applied to the supply chain. The integrated framework for the supply chain and blockchain is analyzed, and K-nearest neighbors (K-NN) is applied to optimize the primary node selection rules of the PBFT consensus algorithm based on the features of participating nodes in the supply chain consensus. Experimental results show that trust evaluation classification of consensus nodes can effectively address efficiency issues caused by view switching, thereby improving the consensus performance of blockchain in terms of throughput, latency, fault tolerance, and other aspects. The proposed method is practical and provides ideas for the application of blockchain in other industries.