Juvix imports
module arch.node.net.storage_types;
import arch.node.types.basics open;
import arch.node.types.crypto open;
import arch.node.types.identities open;
import prelude open;
Storage Types¶
ACL¶
Access control list stored in a Storage object.
Contains ExternalIDs that are members of the list,
the version of the ACL, which is incremented at each update,
and a signature by the ACL owner.
The ACL may be updated by sending an updated version
to a pub/sub topic identified by the ACL owner's ExternalID.
type ACL :=
mkACL@{
members : Set ExternalID;
version : Nat;
sig : Commitment;
};
Chunk¶
A chunk of a storage object.
type Chunk :=
mkChunk@{
children : List ChunkID;
expiry : AbsTime;
acl : Option ACL;
content : ByteString;
};
children- List of chunk IDs of children in the Merkle tree.
expiry- Expiration time after which the chunk must be deleted by each node storing it.
content- Encrypted
ChunkContent. acl- Nodes that are allowed to request the chunk.
ChunkContent¶
The content of a Chunk.
type ChunkContent :=
| InternalNode (List SecretKey)
| LeafNode ByteString;
InternalNode- An internal node of the Merkle tree. Contains decryption keys of its children.
LeafNode- A leaf node of the Merkle tree. Contains a data chunk.
ChunkCommitment¶
Commitment by a node to store a chunk for a certain period of time.
Contains a reference to a Chunk,
along with the NodeID where it is stored,
and an expiry time
type ChunkCommitment :=
mkChunkCommitment@{
chunk : ChunkID;
node : NodeID;
expiry : AbsTime;
sig : Commitment;
};
idChunkIDto commit to.nodeNodeIDwhere theChunkcan be found.expiry- Expiration time, until
nodeguarantees storage. sig- Cryptographic signature of the above fields by
node.