Skip to main content

Introducing SkyeKiwi Protocol

What is SkyeKiwi Protocol?​

SkyeKiwi is using a combination of multiple well-developed cryptographic schema to create a solution of securely sharing information in blockchain networks. The capacities of blockchain networks will be significantly enhanced when programmable secrets can be processed through a decentralized network. We believe an innovative and unique new economic model will be created when secrets are processed on blockchains.

How does it work?​

The SkyeKiwi Client Library reads in files/FormData in binary stream, divide them in chunks, generate a random sealing key of 32 bytes and symmetrically encrypt these chunks with the sealing key. Later on, a list of all CIDs and the sealing key will go through a Threshold secret sharing library then encrypted with the according public key of recipients and pushed to a public IPFS network. The encrypted key shares will be composed into a metadata file and can be securely publicized. It will be stored on IPFS then publish the CID to a smart contract.

Install​

Package NameDescriptionStatus
@skyekiwi/cryptoCryptographic PrimitivesReady
@skyekiwi/diffMyers Diff algorithm. Used by the SkyeKiwi NetworkWIP
@skyekiwi/driverCore Driver of the protocol / exposed APIsReady
@skyekiwi/fileFile stream wrapperReady. Alpha in Browsers
@skyekiwi/ipfsIPFS Client wrapperSee IPFS
@skyekiwi/metadataMetadata PackageReady
@skyekiwi/s-contractUtilities and encoding schema for the sContract InterfaceLimited Capability
@skyekiwi/utilUseful Utility FunctionsReady
@skyekiwi/secret-registryRegister your secret to the SkyeKiwi NetworkLimited Capability

Sample Usage​

// Upstream a document
const registry = new SecretRegistry(mnemonic, {});

const file = new File('/path/to/file');
const sealer = new DefaultSealer(); // with Curve25519

sealer.unlock(mnemonicToMiniSecret(mnemonic));

const encryptionSchema = new EncryptionSchema();
encryptionSchema.addMember(sealer.getAuthorKey());

const result = await Driver.upstream(
file, sealer, encryptionSchema, async (cid: string) => {
// cid of the final encoded metadata;
// we need to handle the behavior to blockchain manually here
await registry.init();
const registryResult = await registry.registerSecret(cid);

// is res is null = blockchain error
expect(res).not.toBeNull();

console.log("The Secret ID is " ,res);
}
);
// Donwstream a Secret 

const sealer = new DefaultSealer(); // with Curve25519
sealer.unlock(mnemonicToMiniSecret(mnemonic));

// this is the result array
let downstreamContent = new Uint8Array(0);
await Driver.downstream(
vaultId, [mnemonicToMiniSecret(mnemonic)], registry, sealer,
(chunk: Uint8Array) => {
downstreamContent = new Uint8Array([...downstreamContent, ...chunk])
}
);
// Update encryption schema(update the sharing list)
const result = await Driver.updateEncryptionSchema(
vaultId, newEncryptionSchema, [mnemonicToMiniSecret(mnemonic)], registry, sealer,
async (cid: string) => {
// cid of the final encoded metadata;
// we need to handle the behavior to blockchain manually here
await registry.init();
const registryResult = await registry.updateMetadata(cid);

expect(registryResult).toEqual(true);
}
);
// Generate Proof-of-Access & Verify One
const sealer = new DefaultSealer();
sealer.key = mnemonicToMiniSecret(mnemonic);

const sig = await Driver.generateProofOfAccess(
vaultId1, [mnemonicToMiniSecret(mnemonic)], registry, sealer,
new Uint8Array([0x0, 0x1, 0x2, 0x3])
);

// should equals true
Driver.verifyProofOfAccess(sig)

Run Test​

  1. Clone this repo to your local environment & install dependencies
git clone git@github.com:skyekiwi/skyekiwi-protocol.git
yarn
  1. Create .env files at the project home directory and write your seed phrase to it
SEED_PHRASE = 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx'
  1. Go to our Discord server for testnet faucet.

  2. Run Tests. The process can take 3 - 10 minutes, depending on network connection.

yarn test
  1. Relax. The test should be able to finish within 5 minutes.

LICENSE​

Apache 2.0. See the LICENSE File.