Skip to content

Conversation

@pbeza
Copy link
Contributor

@pbeza pbeza commented Dec 30, 2024

What ❔

This PR is part of the effort to implement on-chain TEE proof verification. Signatures produced by the TEE Prover are now compatible with the on-chain verifier that uses the ecrecover precompile.

Why ❔

Until now, we've been using non-recoverable signatures in the TEE prover with a compressed ECDSA public key in each attestation – it was compressed because there are only 64 bytes available in the report attestation quote. That worked fine for off-chain proof verification, but for on-chain verification, it's better to use the Ethereum address derived from the public key so we can call ecrecover in Solidity to verify the signature.

This PR goes hand in hand with:

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

@pbeza pbeza force-pushed the tee/feat/solidity-compatible-recoverable-signatures branch 4 times, most recently from 9c15a1b to 1c239e7 Compare December 30, 2024 17:28
@pbeza pbeza requested review from haraldh and slowli December 30, 2024 17:46
pbeza added a commit to matter-labs/teepot that referenced this pull request Dec 30, 2024
This PR is part of the effort to implement on-chain TEE proof
verification. Signatures produced by the TEE Prover are now compatible
with the on-chain verifier that uses the `ecrecover` precompile.

Until now, we've been using _non-recoverable_ signatures in the TEE
prover with a compressed ECDSA public key in each attestation -- it was
compressed because there are only 64 bytes available in the report
attestation quote. That worked fine for off-chain proof verification,
but for on-chain verification, it's better to use the Ethereum address
derived from the public key so we can call ecrecover in Solidity to
verify the signature.

This PR goes hand in hand with matter-labs/teepot#228
@pbeza pbeza force-pushed the tee/feat/solidity-compatible-recoverable-signatures branch from 1c239e7 to 63a7712 Compare December 31, 2024 10:08
pbeza added a commit to matter-labs/teepot that referenced this pull request Dec 31, 2024
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Dec 31, 2024
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Dec 31, 2024
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Dec 31, 2024
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 2, 2025
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 2, 2025
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 3, 2025
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 3, 2025
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 3, 2025
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 6, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 6, 2025
…in report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with:
- matter-labs/zksync-era#3414
- #228
@pbeza pbeza force-pushed the tee/feat/solidity-compatible-recoverable-signatures branch 2 times, most recently from 279292a to c801dd7 Compare January 14, 2025 13:38
@pbeza pbeza force-pushed the tee/feat/solidity-compatible-recoverable-signatures branch from c801dd7 to 27ad86e Compare January 14, 2025 15:16
@pbeza pbeza requested a review from slowli January 14, 2025 15:39
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 16, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 16, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 16, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 16, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 16, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 16, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
pbeza added a commit to matter-labs/teepot that referenced this pull request Jan 16, 2025
…report_data

This PR is part of the effort to implement on-chain TEE proof
verification. This PR goes hand in hand with matter-labs/zksync-era#3414.
@pbeza pbeza force-pushed the tee/feat/solidity-compatible-recoverable-signatures branch from 2fc26b3 to d09d87b Compare January 30, 2025 11:24
Copy link
Contributor

@slowli slowli left a comment

Choose a reason for hiding this comment

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

Other than what looks like an overly complex construction of a secret key, looks good 👍

slowli
slowli previously approved these changes Feb 6, 2025
@pbeza pbeza force-pushed the tee/feat/solidity-compatible-recoverable-signatures branch from 1f00597 to d9855db Compare February 6, 2025 18:09
@pbeza
Copy link
Contributor Author

pbeza commented Feb 7, 2025

JFYI, @haraldh, it's ready to merge. ✅🫡

@haraldh haraldh enabled auto-merge February 17, 2025 14:47
@haraldh haraldh added this pull request to the merge queue Feb 17, 2025
Merged via the queue into main with commit 7241a73 Feb 17, 2025
33 checks passed
@haraldh haraldh deleted the tee/feat/solidity-compatible-recoverable-signatures branch February 17, 2025 15:30
github-merge-queue bot pushed a commit that referenced this pull request Mar 4, 2025
🤖 I have created a release *beep* *boop*
---


##
[26.5.0](core-v26.4.0...core-v26.5.0)
(2025-03-03)


### Features

* add a flag for stage1->stage2 validium migration
([#3562](#3562))
([92e7895](92e7895))
* add custom DA support in external node
([#3445](#3445))
([1a8546d](1a8546d))
* **contract-verifier:** add Etherscan contract verification
([#3609](#3609))
([a4ea0f2](a4ea0f2))
* **da-clients:** raise Avail blob size to 1mb
([#3624](#3624))
([0baa7ff](0baa7ff))
* **eigenda:** implement eigenDA client remaining features
([#3243](#3243))
([88fc971](88fc971))
* preparation for new precompiles
([#3535](#3535))
([3c1f3fb](3c1f3fb))
* **tee:** add support for recoverable signatures
([#3414](#3414))
([7241a73](7241a73))
* **zkos:** Implement ZK OS Merkle tree
([#3625](#3625))
([331e98c](331e98c))


### Bug Fixes

* **api:** Fix pending transactions filter again
([#3630](#3630))
([7afa20f](7afa20f))
* **api:** lock simultaneous tx insertsion with mutex
([#3616](#3616))
([644b621](644b621))
* block.timestamp is not accurate
([#3398](#3398))
([adcb517](adcb517))
* Fflonk versioning
([#3610](#3610))
([fc80840](fc80840))
* Limit number of connections open for GCS interactions
([#3637](#3637))
([6b003e2](6b003e2))


### Performance Improvements

* **api:** Use watch channel in values cache updates
([#3663](#3663))
([3a4bdcf](3a4bdcf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zksync-era-bot <[email protected]>
zkzoomer pushed a commit that referenced this pull request Jun 21, 2025
🤖 I have created a release *beep* *boop*
---


##
[26.5.0](core-v26.4.0...core-v26.5.0)
(2025-03-03)


### Features

* add a flag for stage1-&gt;stage2 validium migration
([#3562](#3562))
([92e7895](92e7895))
* add custom DA support in external node
([#3445](#3445))
([db31e71](db31e71))
* **contract-verifier:** add Etherscan contract verification
([#3609](#3609))
([f13bd80](f13bd80))
* **da-clients:** raise Avail blob size to 1mb
([#3624](#3624))
([0baa7ff](0baa7ff))
* **eigenda:** implement eigenDA client remaining features
([#3243](#3243))
([161da42](161da42))
* preparation for new precompiles
([#3535](#3535))
([3c1f3fb](3c1f3fb))
* **tee:** add support for recoverable signatures
([#3414](#3414))
([7241a73](7241a73))
* **zkos:** Implement ZK OS Merkle tree
([#3625](#3625))
([331e98c](331e98c))


### Bug Fixes

* **api:** Fix pending transactions filter again
([#3630](#3630))
([7afa20f](7afa20f))
* **api:** lock simultaneous tx insertsion with mutex
([#3616](#3616))
([644b621](644b621))
* block.timestamp is not accurate
([#3398](#3398))
([adcb517](adcb517))
* Fflonk versioning
([#3610](#3610))
([fc80840](fc80840))
* Limit number of connections open for GCS interactions
([#3637](#3637))
([6b003e2](6b003e2))


### Performance Improvements

* **api:** Use watch channel in values cache updates
([#3663](#3663))
([3a4bdcf](3a4bdcf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zksync-era-bot <[email protected]>
dutterbutter pushed a commit to dutterbutter/zkstack-cli that referenced this pull request Jul 3, 2025
🤖 I have created a release *beep* *boop*
---


##
[26.5.0](matter-labs/zksync-era@core-v26.4.0...core-v26.5.0)
(2025-03-03)


### Features

* add a flag for stage1-&gt;stage2 validium migration
([#3562](matter-labs/zksync-era#3562))
([92e7895](matter-labs/zksync-era@92e7895))
* add custom DA support in external node
([#3445](matter-labs/zksync-era#3445))
([4ca2e03](matter-labs/zksync-era@4ca2e03))
* **contract-verifier:** add Etherscan contract verification
([#3609](matter-labs/zksync-era#3609))
([180cd32](matter-labs/zksync-era@180cd32))
* **da-clients:** raise Avail blob size to 1mb
([#3624](matter-labs/zksync-era#3624))
([0baa7ff](matter-labs/zksync-era@0baa7ff))
* **eigenda:** implement eigenDA client remaining features
([#3243](matter-labs/zksync-era#3243))
([771e6f0](matter-labs/zksync-era@771e6f0))
* preparation for new precompiles
([#3535](matter-labs/zksync-era#3535))
([3c1f3fb](matter-labs/zksync-era@3c1f3fb))
* **tee:** add support for recoverable signatures
([#3414](matter-labs/zksync-era#3414))
([7241a73](matter-labs/zksync-era@7241a73))
* **zkos:** Implement ZK OS Merkle tree
([#3625](matter-labs/zksync-era#3625))
([331e98c](matter-labs/zksync-era@331e98c))


### Bug Fixes

* **api:** Fix pending transactions filter again
([#3630](matter-labs/zksync-era#3630))
([7afa20f](matter-labs/zksync-era@7afa20f))
* **api:** lock simultaneous tx insertsion with mutex
([#3616](matter-labs/zksync-era#3616))
([644b621](matter-labs/zksync-era@644b621))
* block.timestamp is not accurate
([#3398](matter-labs/zksync-era#3398))
([adcb517](matter-labs/zksync-era@adcb517))
* Fflonk versioning
([#3610](matter-labs/zksync-era#3610))
([fc80840](matter-labs/zksync-era@fc80840))
* Limit number of connections open for GCS interactions
([#3637](matter-labs/zksync-era#3637))
([6b003e2](matter-labs/zksync-era@6b003e2))


### Performance Improvements

* **api:** Use watch channel in values cache updates
([#3663](matter-labs/zksync-era#3663))
([3a4bdcf](matter-labs/zksync-era@3a4bdcf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zksync-era-bot <[email protected]>
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.

3 participants