Vaults (How it works)

From SAFE Network Wiki
Jump to: navigation, search

A Vault is created on a participant's computer when they install the full SAFE Network software and join the SAFE Network.

The Vault on the User's computer cannot be seen by the User. Instead, by way of the Client interface, the User sees a virtual mounted drive that provides access to their distributed data.

When a User creates or alters a file on their virtual drive, the file goes through several processes to ensure the file is securely stored making the best use of the SAFE Network resources.

Vault persona

Vaults have different personas. These persona can be viewed as specific "personalities," each serving a different role in the functioning of the network. While there are numerous specific personas, they can be organised into four main groups:

  • Client Managers
This is a group of personas composed of the routing nodes closest in network addresses to a connected Client node. They are aware of their role as managers because they have a node connection that is not a routing table node: That connected node must therefore be a Client. Examples of Client Manager types are MaidManager (the group that looks after a Maid Account) and MpidManager (the group that looks after public name and public shares/drive for public Clients).
  • NAE Managers
Network Addressable Element Manager groups. The NAE Managers understand their function as they are close to the address that equals the name of a network addressable element being handled (not a Network Addressable Node, but a data or function element). An example of this type is DataManagers (which look after data stored on other nodes).
  • Node Managers
This is the group surrounding a node. They understand that they are Node Managers because the node (Managed Node) appears in their routing table. PmidManagers (the group looking after nodes holding data) represent an example of a Node Manager type.
  • Managed Node
This is a routing node in a group of Node Managers such as a PmidNode (a node holding a data element).

It is vital that these persona groups obtain authority to act in these roles, otherwise a node could claim to belong to any group and perform any function. This authority is gained by each persona sending their persona type in a message to the next group. The next group then accumulates the results, checking and validating the signatures of the entire group.

Data on the SAFE Network

There are two mechanisms utilised by the network that authorise an End User to carry out certain actions via the Client. Authority is obtained by group consensus whenever a Client is PUTting (storing) new data. Alternatively, cryptographic signatures are used if the Client is amending already stored data (a version) or sending safecoin, for example.

Group Consensus

When an End User attempts to PUT a new piece of data, the file is encrypted and broken up into chunks as part of the self-encryption process. It is then passed to a close group of Client Managers. This close group is comprised of the closest vault IDs to the originating vault ID, in terms of XOR distance. This is distance measured in a specific mathematical sense as opposed to the geographical sense. At least twenty-eight of the thirty-two Client Managers must reach consensus before any network operations are carried out.

The Client Managers then pass the chunks to thirty-two DataManagers, chosen by the network as their IDs are closest to the IDs of the data chunk, so the chunk ID also determines it's location on the network.

The network utilises a Scatter/Gather approach, based on Rabin’s Information Dispersal Algorithm, enabling small data loss (up to 4 pieces) without the requirement to retransmit data.

Once consensus is reached, the DataManager passes the chunks to thirty-two PmidManagers, who in turn pass the chunks for storage with PmidNodes. If a PmidManager reports that a PmidNode has gone offline, the DataManager decides, based on rankings assigned to Vaults, into which other Vault to put the chunk of data.

This way the chunks of data from the original file are constantly being monitored and supported to ensure the original data can be accessed and decrypted by the original User.

Any movement of data chunks can only be made if there is a consensus (28 of 32) from the surrounding Vaults. The Vaults cannot act in isolation.

All communications on the SAFE Network are carried out through close groups of 32 nodes. This prevents a rogue node(s) from behaving maliciously. It is not possible for a User to choose their own node ID, or to decide where their data is stored. This is calculated by the network. Every time a node disconnects from the network and reconnects, it is assigned a totally new and random ID.

Click here to see a short video on how Vaults work

Cryptographic Signatures

When End Users are making changes to existing data, such as changing the content of a file, or sending another End User safecoin, the network does not use group consensus, as this layer of complexity and increased network load is not required.

Cryptographic signatures mathematically validate the owner of any piece of data and can prove this beyond any doubt, provided the End User has kept their private key safe. If the End User is the owner of any piece of data and can prove this, by digitally signing their request with their private key, the network permits them access to change the data.