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

[ZKS-05] Caller Is Not Fixed Throughout Function Execution #2076

Merged
merged 13 commits into from Jan 27, 2024

Conversation

vicsn
Copy link
Contributor

@vicsn vicsn commented Oct 11, 2023

Motivation

We should ensure the self.signer is the same throughout a call graph in a single Execution.

As recommended, this PR adds binding and hiding commitments to the signer in each transition, which needs a secret which is constant for the entire execution. We propose the following, which will leak the signer to everyone holding the root_tvk:

  • signer_commitment = hash(signer address || root_tvk)

Notes:

  • performance improvement: each request in an execution has the same signer and scm now, in the future we could refactor and perhaps store a single signer and scm in the Execution
  • we could hypothetically check if all signer commitments in an entire transaction are the same, but perhaps this doesn't leave open the door for more flexible or multi-execute transactions.
  • we cannot use the account view_key as secret because we'd leak it to the party we delegate to. It is also expensive to derive the address from the view_key within the circuit.

Test Plan

  • Requires resampling, including ./resources/block.genesis

@vicsn vicsn requested a review from mdelle1 October 11, 2023 15:57
Base automatically changed from staging to testnet3 October 19, 2023 18:52
@howardwu howardwu changed the base branch from testnet3 to mainnet November 25, 2023 00:12
@AleoHQ AleoHQ deleted a comment from mdelle1 Jan 5, 2024
@vicsn vicsn marked this pull request as ready for review January 5, 2024 11:44
- request::verify::tests::test_sign_and_verify_*
- tests::test_credits::sanity_checks::test_sanity_check_*
@howardwu howardwu merged commit 1a12cad into mainnet Jan 27, 2024
78 checks passed
@howardwu howardwu deleted the commit_self_caller branch January 27, 2024 20:45
@raychu86 raychu86 changed the title [zksecurity 05] Caller Is Not Fixed Throughout Function Execution [ZKS-05] Caller Is Not Fixed Throughout Function Execution Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants