From 6a08bc054f7e4be89f6a2c0aed935e6a5b20d05b Mon Sep 17 00:00:00 2001 From: Nalin Date: Tue, 12 Sep 2023 14:41:40 -0700 Subject: [PATCH] readme: rebrand to p256 verifier (#12) * readme: rebrand to p256 verifier * patch --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a7e76a4..b8564a5 100644 --- a/README.md +++ b/README.md @@ -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. @@ -41,7 +41,7 @@ test vectors, covering a range of edge cases.
Code coverage -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: ``` @@ -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