From dc7a4828ca9facce80f05d0f5ead9b6e6873b264 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Mon, 26 May 2025 17:47:58 +0530 Subject: [PATCH 1/5] updated error message from external keypers and added block time based msg --- internal/usecase/crypto.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/usecase/crypto.go b/internal/usecase/crypto.go index d0c3273..92cad2e 100644 --- a/internal/usecase/crypto.go +++ b/internal/usecase/crypto.go @@ -167,11 +167,19 @@ func (uc *CryptoUsecase) GetDecryptionKey(ctx context.Context, identity string) }) if err != nil { if err == pgx.ErrNoRows { + if registrationData.Timestamp%5 != 0 { + err := httpError.NewHttpError( + fmt.Sprintf("decryption will happen based on gnosis block time, please try again later after %d seconds", registrationData.Timestamp%5), + "", + http.StatusAccepted, + ) + return nil, &err + } // no data found try querying from other keyper via http decKey, err := uc.getDecryptionKeyFromExternalKeyper(ctx, int64(registrationData.Eon), identity) if err != nil { err := httpError.NewHttpError( - err.Error(), + fmt.Sprintf("error while querying decryption key from external keyper: %s", err.Error()), "", http.StatusInternalServerError, ) From 5e773ae66d44c85a7a6576640f82a57299eb06b6 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 10 Jun 2025 16:12:29 +0530 Subject: [PATCH 2/5] update readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 374d634..52f4647 100644 --- a/README.md +++ b/README.md @@ -94,13 +94,14 @@ Refer to the `/register_identity` endpoint in the Swagger documentation for deta > **Note**: When registering identities through our API, the API account address is used to compute the identity that will be returned. If you want to use your own address, you need to submit the registration directly to the registry contract. The contract's definition can be found here: > [ShutterRegistry.sol](https://github.com/shutter-network/contracts/blob/main/src/shutter-service/ShutterRegistry.sol#L1C1-L86C2). +> We follow Gnosis Mainnet block timestamps for `decryptionTimestamp`. The identities will be release on the basis of Gnosis Timestamp only (~every 5 seconds). #### Example Request ```bash curl -X POST https:///register_identity \ -H "Content-Type: application/json" \ -d '{ - "decryptionTimestamp": 1735044061, + "decryptionTimestamp": 1735044060, "identityPrefix": "0x79bc8f6b4fcb02c651d6a702b7ad965c7fca19e94a9646d21ae90c8b54c030a0" }' ``` @@ -286,6 +287,9 @@ The keyper set is designed to handle downtime gracefully. Any missed decryption ### How secure is the Shutter system? The Shutter system uses threshold encryption and distributed cryptographic operations to ensure that no single entity can compromise the security of commitments. +### Why is my decryption key not released after timestamp has elaped? +This is probably because the decryption timestamp is not according to block timestamp of Gnosis chain. We strictly follow Gnosis chain block time to release decryption keys i.e. ~ every 5 seconds. + ## Swagger Documentation For detailed API specifications, including parameters, responses, and error codes, visit the Swagger Documentation: From 361ab8be9764795893b4f2b441b4ec448afe7520 Mon Sep 17 00:00:00 2001 From: blockchainluffy <47202792+blockchainluffy@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:30:59 +0530 Subject: [PATCH 3/5] Update README.md Co-authored-by: Ulrich Petri --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52f4647..ab936d8 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Refer to the `/register_identity` endpoint in the Swagger documentation for deta > **Note**: When registering identities through our API, the API account address is used to compute the identity that will be returned. If you want to use your own address, you need to submit the registration directly to the registry contract. The contract's definition can be found here: > [ShutterRegistry.sol](https://github.com/shutter-network/contracts/blob/main/src/shutter-service/ShutterRegistry.sol#L1C1-L86C2). -> We follow Gnosis Mainnet block timestamps for `decryptionTimestamp`. The identities will be release on the basis of Gnosis Timestamp only (~every 5 seconds). +> We follow Gnosis Mainnet block timestamps for `decryptionTimestamp`. The identities will be released on the basis of Gnosis Timestamp only (~every 5 seconds). #### Example Request ```bash From 7d0e5928c95fe4d89035761011936957e4fc4f1e Mon Sep 17 00:00:00 2001 From: blockchainluffy <47202792+blockchainluffy@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:31:07 +0530 Subject: [PATCH 4/5] Update README.md Co-authored-by: Ulrich Petri --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab936d8..1d3d77e 100644 --- a/README.md +++ b/README.md @@ -287,8 +287,8 @@ The keyper set is designed to handle downtime gracefully. Any missed decryption ### How secure is the Shutter system? The Shutter system uses threshold encryption and distributed cryptographic operations to ensure that no single entity can compromise the security of commitments. -### Why is my decryption key not released after timestamp has elaped? -This is probably because the decryption timestamp is not according to block timestamp of Gnosis chain. We strictly follow Gnosis chain block time to release decryption keys i.e. ~ every 5 seconds. +### Why is my decryption key not released after the given timestamp has elapsed? +This is probably because the decryption timestamp is not aligned to a Gnosis Chain block timestamp. We strictly follow Gnosis Chain block timestamps to release decryption keys i.e. every 5 seconds. In this case simply try again a few seconds later. ## Swagger Documentation From 4c0238f59bef4c4f71d3fa797366f12fa9a64126 Mon Sep 17 00:00:00 2001 From: blockchainluffy <47202792+blockchainluffy@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:31:16 +0530 Subject: [PATCH 5/5] Update internal/usecase/crypto.go Co-authored-by: Ulrich Petri --- internal/usecase/crypto.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/usecase/crypto.go b/internal/usecase/crypto.go index 92cad2e..0e4c8d1 100644 --- a/internal/usecase/crypto.go +++ b/internal/usecase/crypto.go @@ -169,7 +169,7 @@ func (uc *CryptoUsecase) GetDecryptionKey(ctx context.Context, identity string) if err == pgx.ErrNoRows { if registrationData.Timestamp%5 != 0 { err := httpError.NewHttpError( - fmt.Sprintf("decryption will happen based on gnosis block time, please try again later after %d seconds", registrationData.Timestamp%5), + fmt.Sprintf("Timestamp not aligned with block time, decryption is processed based on Gnosis block time, please retry after %d seconds.", registrationData.Timestamp%5), "", http.StatusAccepted, )