Skip to content

Feat/local decrypt result verify followup#192

Open
alexshchur wants to merge 7 commits intomasterfrom
feat/local-decrypt-result-verify-followup
Open

Feat/local decrypt result verify followup#192
alexshchur wants to merge 7 commits intomasterfrom
feat/local-decrypt-result-verify-followup

Conversation

@alexshchur
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: 6788925

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cofhesdk Ready Ready Preview, Comment Mar 25, 2026 2:58pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
cofhesdk-docs Ignored Ignored Mar 25, 2026 2:58pm

Request Review

Copy link
Collaborator

@architect-dev architect-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, the docs are a little verbose but good. One of the comments is about a trust assumption with the way I've implemented the validation - the read contract call will make the ctHash visible to the node operator. I think it would be better to switch back to a local ecrecover and instead fetch (cache?) the sender address from the task manager. Wdyt?

@@ -0,0 +1,79 @@
---
title: Verifying Decrypt Results
description: Validate Threshold Network decrypt signatures received from relayers/backends/caches
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to have some zama stuff in it


The “signer is correct” part refers to the **Threshold Network’s signing key** (a distributed key controlled by the Threshold Network committee), not your wallet address. A `true` result means the chain’s verifier considers this signature a valid attestation from that Threshold Network key for the specific `(ctHash, plaintext)` pair.

Under the hood, this is an `eth_call` to the chain’s TaskManager verifier (no gas), returning a boolean.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually realizing that the implementation that I put in is the wrong one. The public call reveals the value of the ctHash to the node, really I should have done it with a local ecrecover to handle this. The reason I didn't is that signer is a variable in TaskManager so it was easier to do an eth_call. I think instead we should go back to the ecrecover, and use an eth_cal to read the signer address to check against.

Copy link
Collaborator

@architect-dev architect-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants