Allow someone else to write/access my data?

Hello everyone. This is my first post here so I apologize if I’m posting in the wront category.
I’d like to know if it is at this momment possible to create an app where there are multiple roles.
For example ADMIN and USER.
user logins with it’s blockstack ID and then gives the permission to certain ADMIN person to read/write data for his ID. Like a decentralized teaching platform or doctor-patient platform?
I got tasked to research blockchain usecases and now I’d like to make a simple prototype and so far I think I’ll try to use blockstack
Is there any documentation on this topic that I could read?

Hey @kristjan96,

Directly writing to someone else’s storage is not possible, by design. Only the user who owns the data may write to it. If this weren’t the case, then it would be possible for applications to modify your data without your consent.

However, it is possible to implement the semantics of multiple users writing to shared data. You would do something like what Graphite Docs does:

  1. User A writes some data
  2. User A gives user B the ability to read the data
  3. User B reads the data
  4. User B writes their changes, and makes them readable to user A
  5. When user A reads the data, she reads both her data and user B’s changes

Both users have copies of the data, with the changes they each made. The app would show user A and B the most up-to-date version of the data in order to preserve the writes made by A and B.

Hope this helps!


Thank you for your answer, it helps a lot!

I have another question, if I wanted to track all the changes made to the certain document, how could I make it possible to trust the history? In a regular database, someone could edit past fields… I thought something like having a json file for each edit and then making a ethereum transaction which includes the checksum of a file in the message field.
If later someone changed that json file the checksum would change and it wouldn’t match with the one sent in the ethereum transaction.
Would it be possible to create something like this using blockstack? I’ll use your advice for creating multiple users in my application and would love to use blockstack for above example aswell.

I hope I made my question clear enough, document management system and blockchain technology are quite new to me, so I am a bit confused with all the terminology and how everything exactly works

Data reads and writes in Blockstack do not touch the blockchain. Instead, they are sent to Gaia, Blockstack’s decentralized storage system. Data in Gaia is already signed and encrypted, so it can’t be tampered with in-flight or at-rest.

If you want to structure your data so its edit history is preserved and its tamper-resistant, you can do so already without a blockchain. You just need the right data structures :slight_smile: For example, you could structure your data’s edit history as a Merkle tree where each appended leaf includes the previous tree’s root and a signature from the writer. All you need to ensure tamper-resistance are the users’ public keys (which Blockstack provides).

1 Like

At CBT Nuggets, we’re prototyping with gaia only to store and publish learners’ encryption keys, but artifacts from educational achievements (course progress, questions answered, etc) are stored encrypted on IPFS. We plan to use nucypher to give learners the ability to control access to content after it is stored on IPFS. I’m under the impression that Gaia is not intended for large log style database, but would love to hear different opinions.