This paper focuses on the dual application scenarios of blockchain in distributed networks and proposes a data integrity and security scheme based on blockchain technology. Decentralized authentication and data integrity verification based on smart contract and consensus mechanism solves the single point of failure and trust risk problem of traditional centralized architecture. Secure handling and dynamic auditing of private data is realized through verifiable computing protocol and homomorphic encryption. Two data integrity verification architectures are proposed to optimize the efficiency of data integrity verification and data security by combining the tamper-proof feature of blockchain and zero-knowledge proof. When the number of challenge data blocks is 1000, the communication overhead of this paper’s scheme is only 13.08KB, and the computation overhead is 91.84%, 87.92%, and 53.81% lower than that of RDIC, SCLPV, and IBPA, respectively. The scheme in this paper has high processing efficiency in security analysis, and the maximum error rate of performing operations with different bits will not exceed 0.019%. Out of 2000 attacks, the number of successfully attacked is only 12, which is much better than the control method. The research results provide theoretical support and practical path for the landing of blockchain in high privacy demand scenarios such as Internet of Things and medical treatment.