Search code examples
blockchainethereumsubstratezcash

Is there any way to make a specific information on blockchain can only be queried by one specific account?


just want to know, is there any way to make specific information on the blockchain can only be queried by one specific account?

More exactly, I am thinking let the user put their information on chain and give specific account access, so only that account can query that information from chain.

I checked ZK-SNARK, seems like this algorithm is only for verify the information is correct without knowing any detail of the information. Seems like it cannot be used in this case


Solution

  • Any raw data placed on a blockchain is available to everyone on the network. This is one of the fundamental requirements to ensure that multiple distributed and decentralized nodes are able to verify a shared state.

    However, the data placed on chain does not need to be "transparent" to every user. You could, for example, encrypt some data and place it on the blockchain. Of course everyone will be able to see your encrypted data, but only with the decryption key would they be able to make sense of it.

    With the assumption that the blockchain you use has some built in public key cryptography for account authentication, you could use the private key as your encryption/decryption key. Thus only "that account" would have acces to that file (...anyone who knows the private key that corresponds to that account).

    However, all of this logic would need to exist "off-chain". If you submit a transaction with raw data, and expect the blockchain to do the encryption/decryption for you, anyone who runs a node would be able to see that transaction and your raw data. Thus it must be encrypted before it ever reaches the blockchain.