The SAFE Network
April 2019
An introductory guide to the


2
|
The SAFE Network Primer
The SAFE Network –
a brief introduction










created by linking together users’ computers and smartphones that’s designed to solve many




















forms of attack.
3
|
The SAFE Network Primer
Contents
1. Background and fundamentals.... p4
2. A fully autonomous data network.... p7
3. Vaults and Clients.... p10
4. The architecture of the SAFE Network.... p13
5. Node Age.... p17
6. Everything’s encrypted.... p19
7. PARSEC consensus algorithm.... p22
8. Farming for Safecoin.... p26
9. Vault personas.... p29
10. Data types.... p30
11. The SAFE API.... p32
12. How SAFE Network defends against common
types of cyberattack.... p35
13. The promise of the SAFE Network.... p38
4
|
The SAFE Network Primer
1. Background and fundamentals
Background






not stored on central servers but instead are distributed across the machines of the encrypted


















for storage and communication.
5
|
The SAFE Network Primer
20 Fundamental Principles of the SAFE Network
There are a number of core ideas that have driven each stage of the design of the SAFE


1. Allow a person to create an account and login anonymously and without intervention.

2. Enable users to securely and with no controlling intermediaries share information
and messages.


3. Allow the transfer of the Network currency Safecoin to any user free of transaction
costs.
4. Enable Users to anonymously create and share data worldwide.



5. Let anyone browse content anonymously and free of charge and without the need to
create an account.
6. Allow users to associate multiple identities with their account.
7. Let users utilize any of their identities to send/receive Safecoin.
8. Store data in perpetuity. All public/published data on the Network will be

9. Never require passwords to be stored on the Network or on machines used to access
the Network.
10. Allow any user, on any machine, to access the Network leaving no trace of their
presence or activity on the machine.
 

12. Only accept more Vaults (networked storage provided by users’ machines) when it
needs them.


according to demand.
6
|
The SAFE Network Primer
13. Increase farming rewards when it needs more resources (e.g. more Vaults to
increase storage capacity) and decrease rewards when resources are plentiful.
This is the primary mechanism for balancing supply and demand.
14. Rank nodes over time and increase trust in higher ranked nodes.

15. Not have servers!


16. Digitally sign all transactions.


17. Ensure that Client-to-Client direct messages (i.e. those not transmitted via other
nodes in the Network) are free.
18. Never use time as a network tool.


 
20. Allow real-time upgrades in a secure manner.




channels and apps.
For a fuller version of this list, click here
7
|
The SAFE Network Primer
2. A fully autonomous data network








Application
High-level APIs, HTTP, FTP, SMTP
Presentation
Encryption/decryption compression
Context for communication between layers
Session
Controls dialogue between computers
Controls termination and restarts
Transport
Enables transfer of data TCP/UDP
End-to-end connections
Network
Connects hosts on dierent networks IPv4 +
IPv6; Routing of data packets
Data Link
Provides connections between hosts on the
same network (Ethernet MAC addresses)
Physical
Electrical + physical specifications for devices
Cables + Connectors
SOFTWARE
HARDWARE
SAFE NETWORK COMPLEMENTS
LAYER 1 LAYER 2 LAYER 3 LAYER 4 LAYER 5 LAYER 6 LAYER 7
The SAFE Network complements three of the seven networking layers in
the OSI model for improved security, privacy and autonomy





8
|
The SAFE Network Primer








Desktop, mobile,
CLI apps
Language binders
(Javascript, Java, C#)
SAFE app
SAFE Core
Web apps
SAFE browser &
Authenticator plugin
SAFE Authenticator
Component
SAFE Client Libs
The SAFE Network Stack
Vaults
Routing
Crust (TCP, UDP, ųTP
Crust








9
|
The SAFE Network Primer
Routing








eventual consistency, the routing layer uses the consensus mechanism PARSEC (see Chapter
7).


discussed further in the next chapter.

Tell me more (click on links)



The Successful Conclusion of the Crust Tests

10
|
The SAFE Network Primer
3. Vaults and Clients









The Vault



potentially earning Safecoin currency in return. This process of providing a service in return









KEEP IT SIMPLE!


storage by allocating a portion of their hard drives for this purpose – and earning the Safecoin




11
|
The SAFE Network Primer












The Client





WHAT DOES THAT MEAN?
Crust

Vault



Client

SAFE Browser
Authenticator

Self-Authentication

process.
Farming

Safecoin
12
|
The SAFE Network Primer




mediate the login process, or any trusted third party to store and manage users’ credentials.






SAFE Network app authentication flow
SAFE Network
SAFE Application
Authenticator
1. Send authorization
request
2. Request the user
to authorize the
application
5. Application’s
auth URI returned
3. User authorizes
the application
4. App’s credentials
stored in its Access
Container
6. Application connects to
the SAFE Network using the
auth URI provided

safe://

Tell me more (click on links)



SAFE Client libraries (Github)
13
|
The SAFE Network Primer
4. The architecture of
the SAFE Network






This chapter provides a brief introduction to the topic.
Sections




















cryptographically verify the validity of each message and action (such as groups forming, splitting

members of that Section, and by neighbouring Sections, for the life of each session.

14
|
The SAFE Network Primer



occurs, the node receives the Section’s Routing Table and learns














WHAT DOES THAT MEAN?
Distributed hash table 
XOR networking

Section
Group
of the data
Group Consensus

group_size
Bootstrapping

Bootstrap node

Hash function


Data Chain

Sharding

The hash of a chunk
of data serves as the
XOR address on the
Network where it
will be stored, which
in turn determines
the Group of nodes
that will manage it
15
|
The SAFE Network Primer





S0000111…
S000010001…
S0001000…
S0000110…
S0000101…
S0001100…
Each Section (range of XOR addresses) is managed by a selection of unique
nodes. The most trusted Vaults in a Section are called Elders. Elders have
voting rights and also communicate with Elders in neighbouring Sections



group_size
group_size
very likely to change.
Consensus and quorum


in other Sections can cryptographically verify the validity of each message and action. These



16
|
The SAFE Network Primer









containing all the information about this Section.

the more information it has about data that is stored at that address.



addresses.





Notice that there are no external trackers or managers involved in any of these decisions. A Group

Tell me more (click on links)








KEEP IT SIMPLE!




No node in the
SAFE Network
has a complete
overview of the
network
17
|
The SAFE Network Primer
5. Node Age
















at any moment.

KEEP IT SIMPLE!





security measure.
18
|
The SAFE Network Primer








close to impossible for an attacker
to target a particular Section on the


thus vital security features.


greatest Node Age, have voting


(Children, Adults) simply receive

+1
+1
+1
A Vault’s journey to maturity. A Vault must
prove itself in a number of Sections before
it has a chance to be granted voting rights
as a Section Elder.
WHAT DOES THAT MEAN?
Crust

Resource Proof

Node Age

Age reaches a certain value it can be an active participant in the decisions of the Sections.
Churn
static for long.
Elder
Age in the Group.
Tell me more (click on links)





19
|
The SAFE Network Primer
6. Everything’s encrypted

(like a blog safe://website/blog) is fully encrypted, but in this case the keys needed to













to. These connections are also encrypted from bit 1. Crust, the routing library, forces all
communications to be encrypted.
Clients connect via a Proxy Node






encrypted.
KEEP IT SIMPLE!




20
|
The SAFE Network Primer




assured.
Self-encryption of data





encrypted using the hash of another chunk from the same





be recreated. A number of copies of each chunk are stored

The Client retains the keys to decrypt the data locally. That





Multilayered encryption







The SAFE Network
provides a platform
for applications that is
both highly secure and
anonymized by design
21
|
The SAFE Network Primer
Tell me more (click on links)
Connecting to the Sodium crypto library






WHAT DOES THAT MEAN?
Self-Encryption


to leave your machine.
Proxy Node


Data Map

22
|
The SAFE Network Primer
7. PARSEC consensus algorithm
Decentralized consensus















fact that a certain proportion of the nodes may be unreliable or even actively malicious and




current theory.)
Proof of Work








23
|
The SAFE Network Primer







ledger, and the miner is free to spend the coins again.


While such attacks have been successfully launched against some cryptocurrencies, Ethereum




Enter PARSEC








advantage of some features developed for directed acyclic graphs (DAGs) such as gossip and
concrete coins.
WHAT DOES THAT MEAN?
Byzantine fault tolerance
to a third of the nodes (plus 1) is corrupt or faulty.
Asynchronous
arrival of signals.
Gossip
Gossip graph

Valid block
Concrete Coin

Malice Detection
24
|
The SAFE Network Primer












problem is solved by a system of voting.










of the voting process being predictable, PARSEC uses a mechanism called a Concrete Coin

one of the responsive voting nodes, that node being selected at random. The Concrete Coin



KEEP IT SIMPLE!



events. The Elders then vote on their versions of events, eliminating less popular versions as they go.



25
|
The SAFE Network Primer


malicious.

















Tell me more (click on links)






26
|
The SAFE Network Primer
8. Farming for Safecoin

of secure data storage is to earn Safecoin. The idea behind Safecoin is similar to that of


for other currencies.

balance of the user’s account.







farming_rate



farming_rate


space the farming_rate


KEEP IT SIMPLE!


27
|
The SAFE Network Primer

that’s completely independent of the price
farming_rate
according to the amount of free available

are charged at the optimum rate. While the
storing rate is high (available free space is

helping to free up more space. This dynamic
pricing should translate into very competitive
prices for data storage.






Age, PARSEC and other features collectively




multiple smaller nodes.
WHAT DOES THAT MEAN?
Farming
in return.
Farming Attempt



Attempt has been made.
farming_rate a variable used to attract or discourage Farmers in order to maintain a certain

MaidSafeCoin
is live.
Proof of Resource



Age is diminished.
There’s more incentive for
Farmers to provide storage
when the overall spare
capacity is low, and less
incentive when the amount of
free space is high
28
|
The SAFE Network Primer













Tell me more (click on links)



Market
initial
value
Time
S
a
f
e
c
o
i
n
:
e
x
p
e
c
t
a
ti
o
n
o
f
V
a
l
u
e
p
e
r
C
o
i
n
C
o
s
t
o
f
r
e
s
o
u
r
c
e
s
(
C
P
U
,
B
a
n
d
w
i
d
t
h
,
S
t
o
r
a
g
e
)
Time
90%
80%
70%
60%
50%
40%
30%
20%
10%
0%
Farmers
Fundraising Participants
Dev
IP
Resources and currency
29
|
The SAFE Network Primer
9. Vault personas



The Client Manager



A Client account contains details of the number of chunks of data that have been stored on the


LowBalance
error.

GetAccountInfo




Data Manager



Tell me more (click on links)


Safe_vault (Github repository)
30
|
The SAFE Network Primer
10. Data types



MutableData

key 1: value bananas, key 2: value apples
or removed.





operations.
ImmutableData



















31
|
The SAFE Network Primer
safe://service_name.
public_id (e.g. safe://mysite.alice


Public_ID











Tell me more (click on links)





WHAT DOES THAT MEAN?
Network File Storage (NFS)

Decentralized Naming System (DNS)

Public ID chosen name for an account (e.g. alice or maidsafe). An account may register any

Service name

Type tag

Opportunistic Caching


32
|
The SAFE Network Primer
11. The SAFE API








stored. For example,
_documents is used to store
_
downloads is the container

_music is the place to store


to store unencrypted data
(the container is encrypted
even if its contents are
not), and _publicNames

can be looked up for public
information.
Application development


standard practice. There
are safe_app libraries
based on the platform the
application is being built


best supported at present.
Web applications can be

mobile devices.
Credit: Joseph Meagher
SAFE API Flow
Initialise
Connect
• Read public data only
• No login required
• Limited access to
SAFE API
Authorize
• Login required
• Full access to
SAFE API
Types of Data
Mutable
• Entries (key & value)
• Public, Private,
Shared
• Permissions
• Can change
Immutable
• Single value
• Plain or Encrypted
• Can’t change
NFS
• Combination of
Mutable and Immutable
Data
• Main method for
storing files
Free App Handle
Crypto
• Hashing strings
• Signing keys
• App keys
• Encryption keys
• Key pairs
33
|
The SAFE Network Primer
Authorization











CipherOpt and Crypto APIs
The safe_appsafeCipherOpt



Plain
Symmetric
Asymmetric
The safeCrypto
and generating key pairs.
DOM API

window.safe* functions.




Support for XOR-URLs




34
|
The SAFE Network Primer




Fetching a page using its XOR-URL
WebIDs, RDF and SOLID
safe_app_nodejs
themselves to applications and pass information (for example the location of an inbox) using







Tell me more (click on links)









35
|
The SAFE Network Primer
12. How SAFE Network
defends against common
types of cyberattack




Features
Random address allocation




Nodes are added only as needed


Node ageing


Churn
Encryption


Self-Encryption




XOR Networking




36
|
The SAFE Network Primer
Self-Authentication


Proxy Node


Disjoint Sections




Data Chain



PARSEC



Defence against common attacks
Sybil attack















37
|
The SAFE Network Primer
Phishing, keylogging etc



Man in the Middle attacks


DDoS

Quantum computing


Ransomware

inaccessible.
Tell me more (click on links)

38
|
The SAFE Network Primer
13. The promise of
the SAFE Network

already proven themselves under test conditions others, including Safecoin, are still to



information management, medical records and more.












storage architecture to address has the potential to simplify the

for both simplicity and resource savings.










There would be
a rebalancing of
power from the
data-haves to the
data have-nots
39
|
The SAFE Network Primer







Roadmap






use cases.
About MaidSafe

mission to provide security and privacy for everyone by building a








Join the debate at 
Website 
Developer forum 
Developer hub 



