Skip to content

Commit

Permalink
readme: rebrand to p256 verifier (#12)
Browse files Browse the repository at this point in the history
* readme: rebrand to p256 verifier

* patch
  • Loading branch information
nalinbhardwaj authored Sep 12, 2023
1 parent 924d4d0 commit 6a08bc0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## EIP-7212 fallback `P256Verifier` contract
## `P256Verifier` Solidity contract

This repo implements a gas-efficient P256 signature verifier inspired by [Renaud Dubois's implementation](https://github.com/rdubois-crypto/FreshCryptoLib). Verifying a signature costs about 200k gas. Pure function, no precomputation.
This repo implements a gas-efficient P256 signature verifier. Verifying a signature costs about 350k gas. Pure function, no precomputation. This implementation was inspired by [Renaud Dubois/Ledger's implementation](https://github.com/rdubois-crypto/FreshCryptoLib).

**The contract exists at a deterministic CREATE2 address. You can use it on any EVM chain. If a chain has implemented EIP-7212, you pay ~3k gas. If not, you pay ~200k gas. Either way, the contract address and results are identical.**
The contract matches the proposed [EIP-7212 precompile](https://eips.ethereum.org/EIPS/eip-7212), letting us ship it as a [progressive precompile](https://ethereum-magicians.org/t/progressive-precompiles-via-create2-shadowing/).

This contract matches the proposed [EIP-7212 precompile](https://eips.ethereum.org/EIPS/eip-7212), letting us ship it as a [progressive precompile](https://ethereum-magicians.org/t/progressive-precompiles-via-create2-shadowing/).
**The contract exists at a deterministic CREATE2 address. You can use it on any EVM chain. If the chain implements EIP-7212 at the same CREATE2 address, you pay ~3k gas. If not, you pay ~200k gas. Either way, the contract address and results are identical.** This is particularly beneficial for chains that want to maintain full EVM compatibility while adding this new precompiles (upto gas schedules).

The secp256r1 elliptic curve, aka P256, is interesting because it's supported by high-quality consumer enclaves including Yubikey, Apple's Secure Enclave, the Android Keystore, and WebAuthn. P256 verification is especially useful for contract wallets, enabling hardware-based signing keys.

Expand Down Expand Up @@ -41,7 +41,7 @@ test vectors, covering a range of edge cases.

<details>
<summary>Code coverage</summary>
Install the recommended extension to view line-by-line test coverage.
Install the recommended VSCode extension to view line-by-line test coverage.
To regenerate coverage:

```
Expand All @@ -63,7 +63,7 @@ npm i
# This regenerates ../test/vectors.jsonl
npm start
# Validate that all vectors work with SubtleCrypto
# Validate that all vectors produce expected results with SubtleCrypto and noble library implementation
npm test
# Validate that all vectors also work with EIP-7212
Expand Down

0 comments on commit 6a08bc0

Please sign in to comment.