From e4fe548d82484d2ebf99dccf70c4e83a93574083 Mon Sep 17 00:00:00 2001 From: Tore Frederiksen Date: Tue, 1 Oct 2024 13:38:09 +0200 Subject: [PATCH 1/4] docs: updated keyurl description --- docs/references/gateway_api.md | 113 ++++++++++++++++++++++++--------- 1 file changed, 84 insertions(+), 29 deletions(-) diff --git a/docs/references/gateway_api.md b/docs/references/gateway_api.md index ed033c91..3bb29630 100644 --- a/docs/references/gateway_api.md +++ b/docs/references/gateway_api.md @@ -3,13 +3,13 @@ ## Endpoints
- GET /keys ---- Retrieve public key, CRS (for input proof) and bootstrap key files download URLs + GET /keyurl ---- Retrieve links for retrieving the public keys and CRS' in the system. #### Description -This endpoint returns a JSON object containing URLs from an S3 bucket, allowing the client to download key files such as the blockchain public key, CRS files for input proof generation, and the bootstrap key. +This endpoint returns a JSON object containing URLs from an S3 bucket, allowing the client to download key files such as the blockchain public key, CRS files for input proof generation, the bootstrap key, and the address and public verification keys for each of the MPC servers running the TKMS. -For each file, a list of cryptographic signatures is provided to ensure the integrity and authenticity of the downloaded content. These signatures are generated using a threshold signature scheme. This means that instead of needing all the signatures to validate the content, only a subset—specifically one-third of the total signatures (if n nodes are signing)—is required to verify that the content is legitimate. +For each file (with the exception of the verification key and address), a list of cryptographic signatures is provided to ensure the integrity and authenticity of the downloaded content. These signatures are generated using a threshold signature scheme. This means that instead of needing all the signatures to validate the content, only a subset, specifically >1/3 of the total signatures (if n nodes are signing), is required to verify that the content is legitimate. No query parameters are required, as the gateway is already preconfigured for a specific blockchain. @@ -31,34 +31,89 @@ The request is successful, and the response will include a JSON object with the ```json { - "keyId": "ab12cd", - "crsId": "34ef67", - "publicKey": { - "url": "https://s3.amazonaws.com/bucket-name/pubkey", - "signatures": [ - "a5d2...", - "a8cd...", - "c0ff..." + "response": { + "crs": { + "256": { + "data_id": "d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", + "param_choice": 1, + "signatures": [ + "0d13...", + "4250...", + "a42c...", + "fhb5..." + ], + "urls": [ + "https://s3.amazonaws.com/bucket-name-1/PUB-p1/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", + "https://s3.amazonaws.com/bucket-name-2/PUB-p4/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", + "https://s3.amazonaws.com/bucket-name-3/PUB-p2/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", + "https://s3.amazonaws.com/bucket-name-4/PUB-p3/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906" + ] + } + }, + "fhe_key_info": [ + { + "fhe_public_key": { + "data_id": "408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "param_choice": 1, + "signatures": [ + "cdff...", + "123c...", + "00ff...", + "a367..." + ], + "urls": [ + "https://s3.amazonaws.com/bucket-name-1/PUB-p1/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-2/PUB-p4/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-3/PUB-p2/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-4/PUB-p3/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + ] + }, + "fhe_server_key": { + "data_id": "408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "param_choice": 1, + "signatures": [ + "839b...", + "baef...", + "55cc...", + "81a4..." + ], + "urls": [ + "https://s3.amazonaws.com/bucket-name-1/PUB-p1/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-2/PUB-p4/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-3/PUB-p2/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-4/PUB-p3/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + ] + } + } + ], + "verf_public_key": [ + { + "key_id": "408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "server_id": 1, + "verf_public_key_address": "https://s3.amazonaws.com/bucket-name-1/PUB-p1/VerfAddress/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "verf_public_key_url": "https://s3.amazonaws.com/bucket-name-1/PUB-p1/VerfKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + }, + { + "key_id": "408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "server_id": 4, + "verf_public_key_address": "https://s3.amazonaws.com/bucket-name-4/PUB-p4/VerfAddress/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "verf_public_key_url": "https://s3.amazonaws.com/bucket-name-4//PUB-p4/VerfKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + }, + { + "key_id": "408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "server_id": 2, + "verf_public_key_address": "https://s3.amazonaws.com/bucket-name-2/PUB-p2/VerfAddress/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "verf_public_key_url": "https://s3.amazonaws.com/bucket-name-2/PUB-p2/VerfKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + }, + { + "key_id": "408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "server_id": 3, + "verf_public_key_address": "https://s3.amazonaws.com/bucket-name-3/PUB-p3/VerfAddress/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "verf_public_key_url": "https://s3.amazonaws.com/bucket-name-3/PUB-p3/VerfKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + } ] }, - "bootstrapKey": { - "url": "https://s3.amazonaws.com/bucket-name/bootstrapkey", - "signatures": [ - "fd7a...", - "487b...", - "20fe..." - ] - }, - "crs": { - "2048": { - "url": "https://s3.amazonaws.com/bucket-name/crs", - "signatures": [ - "ffee...", - "012f...", - "1ab5..." - ] - } - } + "status": "success" } ``` From e87d6b2f5afce7adf7e9534b61b1ac603827d7cf Mon Sep 17 00:00:00 2001 From: Tore Frederiksen Date: Fri, 4 Oct 2024 09:20:50 +0200 Subject: [PATCH 2/4] fix: typo --- docs/references/gateway_api.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/references/gateway_api.md b/docs/references/gateway_api.md index 3bb29630..9f1fd1a2 100644 --- a/docs/references/gateway_api.md +++ b/docs/references/gateway_api.md @@ -44,9 +44,9 @@ The request is successful, and the response will include a JSON object with the ], "urls": [ "https://s3.amazonaws.com/bucket-name-1/PUB-p1/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", - "https://s3.amazonaws.com/bucket-name-2/PUB-p4/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", - "https://s3.amazonaws.com/bucket-name-3/PUB-p2/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", - "https://s3.amazonaws.com/bucket-name-4/PUB-p3/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906" + "https://s3.amazonaws.com/bucket-name-4/PUB-p4/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", + "https://s3.amazonaws.com/bucket-name-2/PUB-p2/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906", + "https://s3.amazonaws.com/bucket-name-3/PUB-p3/CRS/d8d94eb3a23d22d3eb6b5e7b694e8afcd571d906" ] } }, @@ -63,9 +63,9 @@ The request is successful, and the response will include a JSON object with the ], "urls": [ "https://s3.amazonaws.com/bucket-name-1/PUB-p1/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", - "https://s3.amazonaws.com/bucket-name-2/PUB-p4/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", - "https://s3.amazonaws.com/bucket-name-3/PUB-p2/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", - "https://s3.amazonaws.com/bucket-name-4/PUB-p3/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + "https://s3.amazonaws.com/bucket-name-4/PUB-p4/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-2/PUB-p2/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-3/PUB-p3/PublicKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" ] }, "fhe_server_key": { @@ -79,9 +79,9 @@ The request is successful, and the response will include a JSON object with the ], "urls": [ "https://s3.amazonaws.com/bucket-name-1/PUB-p1/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", - "https://s3.amazonaws.com/bucket-name-2/PUB-p4/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", - "https://s3.amazonaws.com/bucket-name-3/PUB-p2/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", - "https://s3.amazonaws.com/bucket-name-4/PUB-p3/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" + "https://s3.amazonaws.com/bucket-name-4/PUB-p4/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-2/PUB-p2/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088", + "https://s3.amazonaws.com/bucket-name-3/PUB-p3/ServerKey/408d8cbaa51dece7f782fe04ba0b1c1d017b1088" ] } } From a0c2dabdadb00688df1011158f5f0afde21bddd3 Mon Sep 17 00:00:00 2001 From: Tore Frederiksen Date: Fri, 4 Oct 2024 10:49:07 +0200 Subject: [PATCH 3/4] fix: linter issue with links --- docs/getting_started/gateway/configuration.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/getting_started/gateway/configuration.md b/docs/getting_started/gateway/configuration.md index 0e48ab86..18baca29 100644 --- a/docs/getting_started/gateway/configuration.md +++ b/docs/getting_started/gateway/configuration.md @@ -41,7 +41,7 @@ services: ``` **Zama Gateway** requires several specific configurations as shown in the provided `docker-compose-gateway.yml` file. - + | Variable | Description | Default Value | | --- | --- | --- | | GATEWAY__ETHEREUM__CHAIN_ID | Chain ID for fhEVM | 9000 | @@ -54,7 +54,8 @@ services: | GATEWAY__STORAGE__URL | URL for storage gateway | http://localhost:8088 | | ASC_CONN__BLOCKCHAIN__ADDRESSES | Blockchain addresses for ASC connection. Same as `GATEWAY__KMS__ADDRESS` | http://localhost:9090 | | GATEWAY__ETHEREUM__RELAYER_KEY | Private key of the relayer | 7ec931411ad75a7c201469a385d6f18a325d4923f9f213bd882bbea87e160b67 | - + + ## Steps for Running 1. Run the **Zama Gateway** Docker Compose: From f652e9d503d7bb6cafe26b6d0e80ed4236bab0cb Mon Sep 17 00:00:00 2001 From: Tore Frederiksen Date: Fri, 4 Oct 2024 10:52:05 +0200 Subject: [PATCH 4/4] fix: typo in command --- docs/getting_started/gateway/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting_started/gateway/configuration.md b/docs/getting_started/gateway/configuration.md index 18baca29..3d0eb6f5 100644 --- a/docs/getting_started/gateway/configuration.md +++ b/docs/getting_started/gateway/configuration.md @@ -41,7 +41,7 @@ services: ``` **Zama Gateway** requires several specific configurations as shown in the provided `docker-compose-gateway.yml` file. - + | Variable | Description | Default Value | | --- | --- | --- | | GATEWAY__ETHEREUM__CHAIN_ID | Chain ID for fhEVM | 9000 | @@ -54,7 +54,7 @@ services: | GATEWAY__STORAGE__URL | URL for storage gateway | http://localhost:8088 | | ASC_CONN__BLOCKCHAIN__ADDRESSES | Blockchain addresses for ASC connection. Same as `GATEWAY__KMS__ADDRESS` | http://localhost:9090 | | GATEWAY__ETHEREUM__RELAYER_KEY | Private key of the relayer | 7ec931411ad75a7c201469a385d6f18a325d4923f9f213bd882bbea87e160b67 | - + ## Steps for Running