Skip to content

Shared Secret Fixes#492

Open
lydiagarms wants to merge 6 commits into
masterfrom
lyd/sharedSecretOwnershipFix
Open

Shared Secret Fixes#492
lydiagarms wants to merge 6 commits into
masterfrom
lyd/sharedSecretOwnershipFix

Conversation

@lydiagarms

@lydiagarms lydiagarms commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #472. This PR fixes two issues relating to shared secret variables and adds a more user friendly error message:

  • Fixes a bug, where for shared secret variables that are modified in a function where there is a require statement such as require(msg.sender == admin), the ownership of the variable is assigned to the admin. This means the new commitment will be created under the admins public key and not the sharedPublicKey, which is what we want by default.
  • Introduces a fix in the event listener for shared secret variables. Say there are shared between Clients A and B, when client A nullifies one of these variables it will update its own commitment DB, but client B will not know that the commitment is nullified. In this PR, when the commitment DB is accessed we check the nullification is update with the onchain state.
  • Adds an error message, when in orchestration a usable commitment cannot be found.

Checklist

  • Tests added/updated
  • CI passes
  • No secrets/keys committed
  • Docs updated (if needed)
  • Backwards compatible (or noted breaking change)

How to test

  1. Test with Swap.zol where startSwap can only be called by an admin,

…t also fix the owner via the require statement, the sharedPublicKey is used for new commitments
@lydiagarms lydiagarms requested review from SwatiEY and Wei-257 June 4, 2026 15:17
@lydiagarms lydiagarms changed the title fix(orchestration): ensure that for functions with shared secrets tha… Fix ownership of shared secret variables Jun 4, 2026
@lydiagarms lydiagarms marked this pull request as ready for review June 4, 2026 15:22
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch 2 times, most recently from 2b79ede to 36b304c Compare June 5, 2026 14:39
@lydiagarms lydiagarms changed the title Fix ownership of shared secret variables Shared Secret Fixes Jun 10, 2026
Comment thread src/boilerplate/common/commitment-storage.mjs Outdated
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch 3 times, most recently from edc29f2 to 40baa09 Compare June 11, 2026 10:20
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch from 40baa09 to 0abe2a1 Compare June 11, 2026 11:36
Comment thread src/boilerplate/common/backup-encrypted-data-listener.mjs Outdated
Comment thread src/codeGenerators/orchestration/files/toOrchestration.ts Outdated
Comment thread src/codeGenerators/orchestration/files/toOrchestration.ts Outdated
Wei-257
Wei-257 previously approved these changes Jul 7, 2026
@lydiagarms lydiagarms requested a review from AdarshRon July 7, 2026 10:07
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch from db45e2a to 784d97d Compare July 7, 2026 12:06
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch from 784d97d to 64acbf6 Compare July 7, 2026 12:34
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.

Ownership of shared address variables

3 participants