Hi SAFE Devs,
I try to understand the following:
Suppose you want to build a SAFE app that lets a user disclose/share files with some other user (and only with that specific user) in a time-delayed fashion or without action from the sharer, e.g. when certain conditions (time elapsed and no action is needed from sharing user, or user actively triggers the disclosure by pressing a button in the SAFE app, etc) are met.
- User uploads his private files to the SAFE app and specifies conditions when specific other user(s) should get access to that files (under which conditions becomes the private file becomes a shared file)
- File remains private (and time elapses)
- Conditions are met (and sharer does nothing) or disclosure is actively triggered by sharer
- Specific other user(s) get(s) access to that formerly private files.
(Related: Time-lock transactions on the Bitcoin blockchain that hand over an access token, however they are public! Also thought about time-lock shielded transactions on the Zcash blockchain where the access token is stored in the encrypted memo field of the transaction, however Zcash does not support time-locked shielded transactions today)
Some questions on that:
- Is something like that possible with SAFE?
- What are the data structures and mechanisms one has to use for that purpose?
- The user with whom information/files conditionally should be shared has to have some reference via which the sharing could be established. What would that be in SAFE? Is there a “reference concept” directly within SAFE or must the SAFE app provide that reference?
Any hints and feedback is welcome! Thank you!
Time isn’t featured on the network so you’d have to wait for someone to provide a mechanism for anything based on time (since a local machine time could not be relied on).
File sharing will be built in, and sharing with particular individuals part of that. I think it will be possible with the existing API once Mutable Data is in place, but if I’m wrong about that I am sure it is a planned feature. It’s a killer feature after all - file sharing. There have been prototype apps and the odd RFC about creating URLs to share public files. Doing this for private files would require the sharing of a key in addition, which could be sent using SAFE messaging (anyone can send secure messages to someone else’s public ID, via an app or the API).
Not all the pieces are in place but they will be, partly in apps and partly built into the API. If you want to look into the API further, check the RFC on Mutable Data (or wait a shortish while for the API and documentation to be updated - follow the Dev updates for that). Then, come back with questions and someone more familiar with the details than myself can answer.
Hope that helps.
Hey @happybeing, Thanks for sharing your knowledge, I will look into the RFC on Mutable Data!
still exploring the issues described in this topic…
I took some time to deep dive into the SAFE Dev tutorials that greatly explain how to interact with the SAFE API and the data structures AppendableData and StructuredData. Learned a lot by exploring that great resources.
However, what is still unclear to me is how I would create a SAFE app that runs “in the SAFE network” and does certain actions on its own when certain conditions are met, without an action of a human being that triggers some change in data stored on the SAFE network. The SAFE Dev tutorial apps (Email, Website-comments and VideoChat) are all examples for apps where all actions are triggered by humans, no example there of some action that is done by a SAFE app itself (in a background process).
I try to give an example in order to explain what I mean:
- User ‘Alice’ encrypts some message for user ‘Bob’ with the encryption key of ‘Bob’ (as in the Email-App tutorial)
- The encrypted messages is given over to a SAFE app that runs on the SAFE network 24/7. The SAFE app cannot read the encrypted message because it is encrypted for Bob. However, Alice specifies a condition (lets call it conditionForHandover) when she wants the SAFE app to deliver the encrypted message to Bob.
- The app constantly checks if conditionForHandover is fullfilled
- If conditionForHandover is fulfilled, the SAFE app (WITHOUT action triggering from any user!!!) appends the encrypted message to Bob.
I can see which data structures of SAFE will serve for the described use case, but not what means I have to use in order to design a SAFE app that acts as the described “autonomous intermediary”. How to design such an app?
Any hints very welcome here!
The features you are looking for have not been defined or implemented yet.
There is an intention to have some form of notifications to reduce the need for polling (eg when some data is modified).
There has also been talk of providing computation as a network service (eg smart contracts or distributed computation).
But no details on either, which means this is an opportunity to think about what you need and be ready with suggestions.
Hi @happybeing, Thank you again for your immediate response! Would would be the way to suggest such functionality to the SAFE dev community? RFC proposal?
Certainly - you need to work with someone from MaidSafe when you want to start drafting an RFC so posting something here first would be a first step.