engine/
vault.rs

1// Copyright 2020-2021 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4#![allow(clippy::from_over_into)]
5#![allow(clippy::upper_case_acronyms)]
6
7//! Vault is an in-memory database specification which is designed to work without a central server. Only the user which
8//! holds the associated id and key may modify the data in a vault.  Another owner can take control over the data if
9//! they know the id and the key.
10//!
11//! Data can be added to the chain via a `DataTransaction`.  The `DataTransaction` is associated to the chain
12//! through the owner's ID and it contains its own randomly generated ID.
13//!
14//! Records may also be revoked from the Vault through a `RevocationTransaction`. A `RevocationTransaction` is
15//! created and it references the id of a existing `DataTransaction`. The `RevocationTransaction` stages the
16//! associated record for deletion. The record is deleted when the [`DbView`] preforms a garbage collection and the
17//! `RevocationTransaction` is deleted along with it.
18
19mod base64;
20mod crypto_box;
21mod types;
22pub mod view;
23
24pub use crate::vault::{
25    base64::{Base64Decodable, Base64Encodable},
26    crypto_box::{BoxProvider, Decrypt, DecryptError, Encrypt, Key, NCKey},
27    types::utils::{BlobId, ChainId, ClientId, Id, InvalidLength, RecordHint, RecordId, VaultId},
28    view::{DbView, RecordError, VaultError},
29};