SkyeKiwi Protocol Spec
This document describes the core encoding schema for the SkyeKiwi Protocol.
Processing Pipeline & Two Rounds of Encryptionâ
The SkyeKiwi Protocol applies two rounds of encryption on the target secret. And follows a simplified processing pipeline as below:
- Pre-processing: read in the incoming data in bytes stream and chunckify the stream to a fixed size depends on network condition.
- (First Encryption) Core Encryption: use a randomly generated private key on
Ed25519
curve to symmetrically encrypt the chunks. After each encryption process, the encrypted chunk will be stored in IPFS. - Compile the
PreSeal
metadata: the list of the encrypted chunks, the private key used for encryption, a version number, the hash of the original file will be encoded into a fixed size 114 bytesPreSeal
metadata. Refer to the Metadata section for more details. - (Second Encryption) Seal Metadata: the 114 bytes
PreSeal
metadata will be encrypted with the public key of the recipeints according to aEncryptionSchema
and encoded into theSealed
metadata. TheSeale
metadata will also be stored in IPFS. - Write to Secret Registry: the IPFS CID of the
Sealed
metadata will be pushed to the Secret Registry on the SkyeKiwi Network.
Metadataâ
The PreSeal
metadata follows the following schema:
// NOTE: ordering matters!
pub struct PreSeal {
chunk_cid: types::ipfs::CID, // 46 bytes
hash: types::file::Hash, // 32 bytes
sealing_key: types::crypto::SecretboxKey, // 32bytes
version: [u8; 4] // 4 bytes
}
The Sealed Metadata
follows the following schema:
// NOTE: ordering matters!
pub struct SealedMetadata {
is_public: bool, // encoded into 2 bytes [0, 0] for false, [1, 1] for true
cipher: Vec<u8>, // encrypted PreSealed data concatenated together
members_count: u64, // not encoded! Derived field
version: [u8; 4], // enoded into 4 bytes
}
note
The length of the cipher
on SealedMetadata
is always equal to 186 bytes multiplied by the number of recipients.
Implementationsâ
Currently the SkyeKiwi Protocol has been implemented on the following platforms:
- Browser/TypeScript version: Source Code
- The Intel SGX, Rust version: Source Code