On-chain v off-chain user specific data


I am building a dapp and there is some on-chain data and off chain data.

Obviously certain data is token related and absolutely must be stored on the blockchain via my smart contract(s).

At the same time though, we cannot store everything on the blockchain for cost reasons. E.g. certain meta information relating to a user… e.g. their profile data. This data could be stored in a database perhaps.

My question is about the best way of connecting on chain data to off chain data securely and how to deal with authentication exactly

For instance:

  1. Lets say there is a front facing web application for my Dapp. Should I allow users to register and sign-in using an Oauth2 provider ? and then later on let the dapp associate (via metamask and web3) a user’s ethereum account with this oauth identity ? This could work but things could get out of whack


  1. should everything basically hang off of the users ethereum account ? i.e. we store all off chain data relating to a user in our database and key it against their ethereum account. I am not sure how one keeps data private from other users though if one knows another users public ethereum address though

@cryptoreg @filip

1 Like