The invention discloses a safety three-dimensional code for a block chain and a generation and decoding method. The safety three-dimensional code comprises a code word positioning area, a code word starting point confirmation area, a code word control information area, a code word data information area and a picture area. Pictures, two-dimensional code and/or three-dimensional code words and setsare embedded into the picture area. The generation method comprises the following steps: acquiring data information to be transmitted and a picture, a two-dimensional code and/or a two-dimensional code word to be embedded; extracting picture characteristic value information and storing in a server, and forming data information to be transmitted through encryption, compression and error coding processing; and determining the composition and size of the security three-dimensional code, and filling the security three-dimensional code with the content of each region to generate a corresponding security three-dimensional code. The decoding method comprises the steps of scanning and photographing the safety three-dimensional code, obtaining a picture, processing and restoring the picture, performing error control decoding and decompression on restored information, and reading and decrypting data information through the code scanning terminal. According to the invention, the anti-counterfeiting performance is effectively improved, and the visual identification of the embedded picture is improved.