The embodiment of the invention discloses a commodity anti-counterfeiting method and a device. The method comprises the following steps of generating the public key and the private key of a commodity; storing the hash values of the serial number, the public key and the private key of the commodity and the circulation data of the commodity in a common
database by using a block chain; upon receiving the
verification information of the public key of the commodity and determining the stored state of the public key in the common
database, determining the first legal sales state of the commodity according to the serial number and the circulation data of the commodity, and marking the state of the commodity to be sold out; upon receiving the
verification information of the secret key of the commodity and determining the stored state of the public key corresponding to the secret key in the common
database, determining the first legal
verification state of the commodity according to the serial number and the circulation data of the commodity, and marking the state of the commodity to be verified. Through preparing the public key and the private key of the commodity into special two-dimension codes and pasting the special two-dimension codes onto the outer
package and the surface of the commodity, the
readability, the verifiability and the binding performance of anti-counterfeiting marks are ensured. Meanwhile, by means of the block chain, the commodity circulation
traceability and the commodity source uniqueness are ensured. At the same time, the cost is reduced.