Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add content to tkms documentation #18

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/getting_started/tkms/contract.md
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
# Application Smart Contract

The application smart contract (ASC) is the main entrypoint of the TKMS.

It allows the user to request decryption and re-encryption of ciphertexts, and key-generation.

The FHEVM interacts with the TKMS through a gateway.

## Key operations

### Key generation

The first thing that should be done is generating the shared private keys, and public keys.

This is done by calling the ASC.

### Key rotation

Key rotation isn't implemented yet.

## Ciphertext operations

All ciphertexts operations requires a proof of ownership that should be verify against the headers of the blockchain they belong to.

That means that updates of the blockchain that uses said ciphertexts should be propagated to the KMS blockchain inclusion contract.

They also need a signature from said blockchain to ensure that the ciphertext indeed belongs to the blockchain.

Ciphertexts should be stored in a kv-store and their handle should be provided when calling the ASC contract.

### Re-encryption

Re-encryption should also provide a public key to use to re-encrypt the value, thus giving ownership of the underlying value to the owner of the private key.

### Decryption

Decryption makes the ciphertext visible by all.

2 changes: 2 additions & 0 deletions docs/getting_started/tkms/create.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Request the creation of a new private key


4 changes: 4 additions & 0 deletions docs/getting_started/tkms/run.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Run a KMS

Running a TKMS locally can be done by cloning [kms-core](https://github.com/zama-ai/kms-core) and following the `docker compose` commands documented in `blockchain/simulator`.

To interact with the TKMS please refer to [contract](./contract.md).
2 changes: 2 additions & 0 deletions docs/getting_started/tkms/zama.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Use Zama's TKMS

Zama's threshold key management system (TKMS) allows users to decrypt and re-encrypt encrypted values if they have proof of "ownership" of the given ciphertext.