Because of the frequent occurrence of drug safety incidents in recent years, drug safety cannot be effectively guaranteed. The purpose of this study is to establish a blockchain-based drug traceability system and strengthen the construction of a drug information technology traceability system. Because the traditional drug traceability system depends on a certain center, there are many traceability participants, and the information is difficult to integrate, resulting in incomplete and unreliable traceability information. The use of blockchain technology can achieve data tamper-proof and decentralization so that each drug can be tracked through the unique identifier on the blockchain to ensure the integrity and authenticity of the data. Finally, "one thing, one code, one traceability code" will be realized, to strengthen the sharing of traceability information, realize the traceability of the whole variety and process, and improve drug safety. The drug traceability system consists of the data collection system, product traceability identification system, data statistical analysis system, and other subsystems. The platform uses distributed ledgers, blockchain, data technology, smart contracts, data mining and analysis, and other technologies to achieve multiple functional requirements such as anti-counterfeiting traceability of enterprise products, process tracking, data statistics, and so on.