Rust personal data management service. Implements a clear API to track and manage aribtrary personal data, including its modification history, and access.
We start with a genesis block and seed block with unique UUIDs; each is generated based on a user's public key, with creation timestamp and signature. Each subsequent block is generated based on the aggregates of the previous blocks' hashes, always including the genesis block, with its own unique UUID, creation timestamp, and signature.
The first block after genesis is the seed block, which contains a list of all the user's public keys and core information. Subsequent blocks contain an aggregated list of related blocks and a value object. Each entry is a tuple of (key, value, signature). The key is a string, the value is a string (e.g. an encoded JSON object), and the signature is a string. The signature is the signature of the concatenation of the key and the value, signed by the private key of the user who created the entry. The key is the hash of the concatenation of the previous block hash and the signature of the previous entry.
Blocks and referenced data (pictures, videos, audio, documents, etc.) can be stored in any number of configurable cloud storage services, via a clear API to store, track, and manage access to the data.
Blocks can be replicated on any number of configurable cloud storage services, and their visibility is governed by a configurable access control list within its networking branch. Blocks are always kept in memory for quick access. Additional data is stored in the cloud storage service of the user's choice.
Value objects can be any JSON object, and can contain any number of properties. The seed block is the first example of this value format, containing a list of all the user's public keys as well as pointers to the hashes of all the basic networking, security, and identity information. These three categories are the only ones that can be modified by the user and form branches for each of their respective trees. The user can then create entries for each of these branches, which tie back to the seed block, and the seed block will tie back to the genesis block.
Clone the repository and run cargo build
to build the project.
Set the following environment variables (e.g. in your .env file):
Required:
MONGODB_URI
: the MongoDB connection string.MONGODB_DB
: the MongoDB database name.
Optional:
MONGODB_REQUESTS_COLLECTION
: the MongoDB collection name for requests.MONGODB_SERVERS_COLLECTION
: the MongoDB collection name for servers.MONGODB_DOMAINS_COLLECTION
: the MongoDB collection name for domains.TRUSTCHAIN_DOMAIN
: the domain name for the service.TRUSTCHAIN_PORT
: the port number for the service.
- Create or import private and public keys
- Create or import certificates
- Configure storage services
- Configure domains
- Configure servers
- Configure users
Run cargo run
to run the project.
Request: { "public_key": "<public_key>", "ip_address": "<ip_address>", "method": "", "port?": , "signature?": "", "payload?": , "timestamp?": , "type?": "", "uuid?": "", "status?": "", }
Server: { "ips": <ip[]>, "ports": <port[]>, "public_key": "<public_key>", "created": , "updated?": , "deleted?": , "services": <service[]>, "signature": "", "type?": "", "uuid": "", "status": "", }
Domain { "uuid": "", "name": "", "public_key": "<public_key>", "private_key?": "<private_key>", "signature": "", "dns": "", "ips": <ip[]>, "ports": <port[]>, "protocol": "", "type?": "", "created": , "updated?": , "deleted?": , "status": "", }
Service: { "uuid": "", "name": "", "port": <port[]>, "protocol": "", "public_key": "<public_key>", "private_key?": "<private_key>", "signature": "", "type": "<type.service>", "created": , "updated?": , "deleted?": , "status": "", }
type.service: { "uuid": "", "name": "", "signature": "", "created": , "updated?": , "deleted?": , "status": "", "tags?": <tag[]>, "type?": "", }
--Security--
Verification Method: { "created": , "deleted?": , "updated?": , "algorithm": "", "public_key": "<public_key>", "private_key": "<private_key>", "signature": "", "status": "", "type?": "", }
Verification Attempt: { "created": , "deleted?": , "updated?": , "verification_method": "<verification_method>", "signature": "", "type?": "", "uuid": "", "public_key": "<public_key>", "private_key?": "<private_key>", "algorithm": "", "status": "", }
--Identity--
User: { "uuid": "", "status": "", "name?": "", "profile": "", "public_key": "<public_key>", "private_key?": "<private_key>", "signature": "", "created": , "updated?": , "deleted?": , "connections": <connection[]>, "contacts?": <contact[]>, }
Connection: { "created": , "deleted?": , "updated?": , "user": "", "public_key": "<public_key>", "signature": "", "status": "", "tags?": <tag[]>, "type?": "", }
Contact: { "acl?": <access_control_list>, "aggregates?": <aggregate[]>, "created": , "deleted?": , "updated?": , "uuid": "", "public_key": "<public_key>", "signature": "", "status": "", "tags?": <tag[]>, "type?": "", "phone?": <phone[]>, "email?": <email[]>, "address?": <address[]>, "website?": <website[]>, "social?": <social[]>, "notes?": <notes[]>, "services?": <service[]>, "tags?": <tag[]>, }
-- Data --
Photo: { "acl?": <access_control_list>, "aggregates?": <aggregate[]>, "uri": "", "uuid": "", "public_key": "<public_key>", "signature": "", "created": , "updated?": , "deleted?": , "status": "", "name?": "", "hash": "", "description?": , "width?": , "height?": , "format?": "", "size?": , "metadata?": , "tags?": <tag[]>, }
Video: { "acl?": <access_control_list>, "aggregates?": <aggregate[]>, "uri": "", "uuid": "", "public_key": "<public_key>", "signature": "", "created": , "updated?": , "deleted?": , "status": "", "name?": "", "hash": "", "format?": "", "description?": , "metadata?": , "length?": , "width?": , "height?": , "size?": , "tags?": <tag[]>, }
Audio: { "acl?": <access_control_list>, "aggregates?": <aggregate[]>, "uri": "", "uuid": "", "public_key": "<public_key>", "signature": "", "created": , "updated?": , "deleted?": , "status": "", "name?": "", "hash": "", "format?": "", "description?": , "metadata?": , "length?": , "size?": , "tags?": <tag[]>, }
Document: { "acl?": <access_control_list>, "aggregates?": <aggregate[]>, "uri": "", "uuid": "", "public_key": "<public_key>", "signature": "", "status": "", "created": , "updated?": , "deleted?": , "hash": "", "name?": "", "format?": "", "description?": , "metadata?": , "size?": , "tags?": <tag[]>, }
Thing: { "acl?": <access_control_list>, "aggregates?": <aggregate[]>, "uri": "", "uuid": "", "public_key": "<public_key>", "signature": "", "created": , "updated?": , "deleted?": , "status": "", "name?": "", "hash": "", "tags?": <tag[]>, "value": , }