Skip to content

Post quantum precompile usage guidance and example - #505

Closed
quantova-inc wants to merge 4 commits into
circlefin:mainfrom
quantova-inc:pq-usage-guidance
Closed

quantova-inc wants to merge 4 commits into
circlefin:mainfrom
quantova-inc:pq-usage-guidance

Conversation

@quantova-inc

Copy link
Copy Markdown

Following the thread on binding the precompile, this is the split osr21 scoped. The precompile stays neutral and I add the safe usage layer around it.

What is in here.

  1. Docs at contracts/src/pq/README.md. The precompile verifies a signature over the exact bytes and injects no chain id, no verifying contract and no purpose, the same as ecrecover. The caller has to bind the domain into the signed message. A domain stops cross domain reuse. A nonce and a deadline stop replay inside a domain.
  2. An example at contracts/src/pq/examples/PQAuthExample.sol. It builds an EIP 712 digest over chain id, verifying contract and a purpose, passes that 32 byte digest as the message, marks the nonce used before the verify call and checks a deadline.
  3. A conformance manifest at contracts/src/pq/examples/conformance-manifest.md. It maps each of the six existing vectors to its expected result and records the corpus source and license. The source is the slh_dsa crate under Apache 2.0, generated by the existing generate_pq_test_vectors.rs.
  4. Example tests at contracts/test/pq/PQAuthExample.t.sol. Eight tests. A changed chain, a changed contract and a changed purpose each fail. A reused nonce is rejected while the precompile verifies the same signature again, which shows the replay stop is the contract's job and not the precompile's.

All eight pass on solc 0.8.29. The contract logic around the precompile call is about 104k gas and deployment is about 387k.

Happy to maintain this and add more coverage if you want it. partnerships@quantova.org

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Hi @quantova-inc,

Thank you for your interest in contributing to Arc Node.

This PR has been automatically closed because it does not reference a GitHub issue. All PRs must reference an existing issue using the format Closes: #XXX.

To contribute properly:

  1. Find an existing issue you'd like to work on, or open a new issue describing your proposed change
  2. Comment on the issue requesting assignment and wait for maintainer approval
  3. Only submit a PR after you have been assigned to the issue

Please see our CONTRIBUTING.md for more details.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unsigned Commits Detected

The following commits are missing a verified signature:

  • f9df3d6 by Quantova-Inc
  • c0e62d9 by Quantova-Inc
  • f27a9c6 by Quantova-Inc
  • 3462d3e by Quantova-Inc

How to fix: Sign your commits.

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.

1 participant