Uploading a file
A file upload proceeds in the following steps
-
Check filename is valid and free
-
Create a transaction file with a plan for the upload
-
For every section of the file which is up to 5 MiB:
- Encrypt the 5 MiB file section with a random symmetric key
- Split the cipher text into 128 KiB fragments
- Create a FileAccess cryptree node with merkle links to all the resulting fragments and an encrypted link to the next section (even if there isn't a next section)
- Add the FileAccess to the champ of the writing key pair under a random 32 byte label
-
Add a cryptree link from the parent directory to the file
-
Delete the transaction file
A modification, such as uploading a file, can be done through any Peergos server as the writes are proxied through an ipfs p2p stream to the owner's storage ipfs node.