A computer-implemented method for processing blockchain data in a trusted execution environment, TEE, executing on a computing device communicably coupled to a blockchain network, the method comprising, at the TEE: retrieving, in response to a blockchain node dropping out from the blockchain network, a plurality of blocks from a blockchain node of the blockchain network; encoding the plurality of blocks using error correction coding, ECC, to generate a plurality of encoded blocks; for each encoded block in the plurality of encoded blocks: dividing the encoded block into a plurality of datasets, wherein the plurality of datasets include one or more datasets of information bits and one or more datasets of redundant bits and wherein a number of the plurality of datasets equals a number of blockchain nodes of the blockchain network and a code rate of the plurality of encoded blocks equals a minimum number of honest blockchain nodes required by the blockchain network divided by a total number of blockchain nodes, and calculating hash values of the plurality of datasets; sending, to each of a plurality of blockchain nodes of the blockchain network, a request that includes at least one of the plurality of datasets, the hash values, and a data storage scheme that provides assignments of the plurality of datasets to the plurality of blockchain nodes; receiving responses for accepting the request from at least a number of blockchain nodes that equals a number of the one or more datasets of information bits; and sending, to each of the plurality of blockchain nodes, a notification for adopting the data storage scheme. retrieving, in response to a blockchain node dropping out from the blockchain network, a plurality of blocks from a blockchain node of the blockchain network; encoding the plurality of blocks using error correction coding, ECC, to generate a plurality of encoded blocks; for each encoded block in the plurality of encoded blocks: dividing the encoded block into a plurality of datasets, wherein the plurality of datasets include one or more datasets of information bits and one or more datasets of redundant bits and wherein a number of the plurality of datasets equals a number of blockchain nodes of the blockchain network and a code rate of the plurality of encoded blocks equals a minimum number of honest blockchain nodes required by the blockchain network divided by a total number of blockchain nodes, and calculating hash values of the plurality of datasets; dividing the encoded block into a plurality of datasets, wherein the plurality of datasets include one or more datasets of information bits and one or more datasets of redundant bits and wherein a number of the plurality of datasets equals a number of blockchain nodes of the blockchain network and a code rate of the plurality of encoded blocks equals a minimum number of honest blockchain nodes required by the blockchain network divided by a total number of blockchain nodes, and calculating hash values of the plurality of datasets; sending, to each of a plurality of blockchain nodes of the blockchain network, a request that includes at least one of the plurality of datasets, the hash values, and a data storage scheme that provides assignments of the plurality of datasets to the plurality of blockchain nodes; receiving responses for accepting the request from at least a number of blockchain nodes that equals a number of the one or more datasets of information bits; and sending, to each of the plurality of blockchain nodes, a notification for adopting the data storage scheme. <EOS>