Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

ACP-204 proposes adding a P-256 (secp256r1) signature verification precompile to Avalanche C-Chain. This would enable efficient native verification of signatures generated by WebAuthn-compatible authenticators and device security hardware.

This article translates, summarizes, and expands on the following proposal. Statements about activation and network support reflect the proposal as discussed in the original article dated September 25, 2025.

More EIP, BIP, SLIP, CAIP, ENSIP, RFC, and ACP explainers:

Overview

ACP-204 introduces a precompiled contract for verifying signatures on the secp256r1 (P-256) elliptic curve.

A precompile is a native operation exposed through a designated EVM address. Computationally intensive operations, including cryptographic verification, can be implemented natively rather than entirely in Solidity, reducing execution overhead and gas consumption.

The proposed precompile uses address 0x0000000000000000000000000000000000000100 and follows Ethereum's EIP-7951 specification for P-256 verification.

This makes it possible to verify P-256 signatures from compatible WebAuthn authenticators, passkeys, and device-backed keys directly on C-Chain. Face ID and Touch ID can authorize the use of a device-protected key, but the biometric data itself is not submitted to the precompile.

EIP-7951 uses the same address and a compatible interface as RIP-7212, which has been adopted by various Ethereum Layer 2 networks. This facilitates interoperability between implementations.

Motivation

P-256 is widely supported by modern device security infrastructure, including Apple's Secure Enclave, Android Keystore, and FIDO2/WebAuthn authenticators.

Historically, EVM networks without a native P-256 verifier relied on Solidity-based implementations for P-256 signature verification, whereas ecrecover provides native secp256k1 signature recovery. The proposal estimates the gas cost of Solidity-based P-256 verification at approximately 200,000 to 330,000 gas per verification.

A native precompile would reduce the computational cost of P-256 verification, making device-backed signing workflows and passkey-based authentication more practical for smart contract applications.

Potential applications include account abstraction, multifactor authentication, and simplified key management. The precompile is a cryptographic primitive; applications must implement their own authentication and authorization logic.

Enterprise and institutional adoption

Consideration Description
Easier onboarding Organizations can integrate compatible existing device authentication mechanisms and reduce reliance on workflows that require users to manage seed phrases or separate hardware wallets.
Compliance Institutions may integrate previously approved device-security infrastructure and identity management systems. Compliance still depends on the complete system and applicable requirements.
Cost optimization The proposed 6,900-gas verification cost is substantially lower than the estimated 200,000–330,000 gas of Solidity-based verification. This makes large-scale verification workflows more economically feasible.

Relative to the stated baseline, 6,900 gas represents approximately 29 to 48 times lower verification gas consumption. Actual transaction costs also include other execution overhead.

Ecosystem consistency

Using the same address as RIP-7212, 0x000...0100, helps developers reuse compatible libraries and tools across EVM networks.

However, applications must account for differences in activation status, gas pricing, and validation requirements. A shared address alone does not guarantee identical behavior on every network.

Specification

ACP-204 proposes implementing the P-256 signature verification precompile defined by EIP-7951 on Avalanche C-Chain at 0x0000000000000000000000000000000000000100.

Core functionality

Item Description
Input 160 bytes containing the message hash, signature components r and s, and public key coordinates x and y.
Output 32 bytes representing the integer 1 on successful verification; empty output on failure.
Gas cost 6,900 gas, based on the EIP-7951 design.
Verification standard ECDSA signature verification on P-256, following the NIST FIPS 186-3 requirements referenced by the proposal.

The message hash, signature components, and public key coordinates occupy 32 bytes each, in that order.

Successful verification returns a 32-byte value whose last byte is 0x01. Invalid input or an invalid signature results in empty output. Callers should distinguish this from an unsuccessful EVM call, such as one that runs out of gas.

Activation

As described in the original proposal, the precompile is intended to be activated through an Avalanche network upgrade. Other Avalanche EVM L1s or subnets can adopt the functionality through their own compatible client software and upgrade configurations.

Reference specification

EIP-7951 defines the underlying P-256 verification interface, including the validation requirements. Implementations should follow that specification rather than infer consensus behavior from illustrative examples.

Compatibility

The proposal introduces a new precompile without modifying existing opcode definitions.

Consideration Description
Dedicated address The proposed address is 0x0000000000000000000000000000000000000100.
Existing functionality The change leaves unrelated existing opcodes unchanged. Adding a precompile nevertheless changes consensus-critical execution behavior at its designated address.
Explicit use Applications generally use the precompile by calling its address. Contracts that already interact with that address must account for its changed behavior after activation.

C-Chain activation requires a coordinated network upgrade. Other Avalanche EVM L1s and subnets can adopt the functionality independently through compatible client releases and their own activation mechanisms.

Security

Cryptographic security

P-256 is a widely studied, standardized elliptic curve. It is generally considered to provide a security level comparable to secp256k1.

ACP-204 follows the EIP-7951 verification requirements, which reference NIST FIPS 186-3. Implementations must consistently validate the signature and public key inputs.

Implementation security

Unlike ECRECOVER, which recovers an address from a secp256k1 signature, the P-256 precompile verifies the supplied signature against an explicitly provided public key. This fits the public-key-based verification model used by WebAuthn and device-backed authentication systems.

The design does not impose an additional low-s requirement to eliminate signature malleability. Applications that require canonical signatures can enforce additional restrictions in their own verification logic. Replay protection should be based on the signed authorization and its nonce or equivalent identifier, rather than the uniqueness of the signature bytes.

Invalid public key coordinates and out-of-range r or s values must fail verification.

Network security

The gas cost is intended to reflect the computational work performed by the verifier and limit denial-of-service risks associated with inexpensive but computationally expensive operations.

As with other precompiles, deterministic execution and agreement across client implementations are consensus-critical. The proposal does not introduce a new consensus mechanism.

Illustrative call flow

sequenceDiagram
    participant Contract as コントラクト
    participant Precompile as プリコンパイル(0x...0100)
    Contract->>Precompile: messageHash, r, s, x, y(合計160B)
    Precompile-->>Contract: 成功=32B(0x...01) / 失敗=データなし

The original sequence diagram retains its Japanese labels. A calling contract supplies the message hash, r, s, x, and y, and the precompile returns a 32-byte success value or empty output.

Reference implementation

The proposed implementation builds on existing cryptographic libraries and EVM integration patterns.

Component Role
EIP-7951 implementation in Go-Ethereum Provides a reference for the P-256 validation rules and gas pricing.
Coreth integration Registers the precompile and integrates its execution with the C-Chain client.
Go standard cryptographic libraries Provides P-256 and ECDSA functionality through packages such as crypto/elliptic and crypto/ecdsa.

The following pseudocode illustrates the registration and verification structure. It is preserved from the original article, including its Japanese comments. Actual file layouts, types, and consensus validation requirements must follow the relevant client implementation.

go
// 擬似コード:プリコンパイル登録
var addrP256 = common.HexToAddress("0x0000000000000000000000000000000000000100")

type P256Verify struct{}

func (p *P256Verify) RequiredGas(input []byte) uint64 { 
    return 6900 // EIP-7951ベースの見積り
}

func (p *P256Verify) Run(input []byte) ([]byte, error) {
    // 入力: 160バイト [msgHash(32) | r(32) | s(32) | x(32) | y(32)]
    if len(input) != 160 { return nil, nil /* 失敗=無返却 */ }

    msgHash := input[0:32]
    r := new(big.Int).SetBytes(input[32:64])
    s := new(big.Int).SetBytes(input[64:96])
    x := new(big.Int).SetBytes(input[96:128])
    y := new(big.Int).SetBytes(input[128:160])

    curve := elliptic.P256()
    if !curve.IsOnCurve(x, y) { return nil, nil }

    pub := ecdsa.PublicKey{Curve: curve, X: x, Y: y}
    ok := ecdsa.Verify(&pub, msgHash, r, s)
    if !ok { return nil, nil }

    // 成功時は32バイト(末尾=0x01)を返す
    out := make([]byte, 32)
    out[31] = 0x01
    return out, nil
}

// 起動時にレジストリへ登録
func RegisterPrecompiles(reg map[common.Address]Precompile) {
    reg[addrP256] = &P256Verify{}
}

The example checks the input length, checks whether the public key is on the curve, verifies the ECDSA signature, and returns the success value or empty output.

This is illustrative pseudocode, not a verified implementation of all EIP-7951 validation and gas-accounting requirements. In particular, native cryptographic library behavior should not be assumed to establish complete consensus compatibility without specification-specific tests.

The C-Chain client must enable the precompile at the configured network upgrade boundary.

Conclusion

ACP-204 proposes native P-256 signature verification for Avalanche C-Chain, reducing verification gas costs and supporting applications that use compatible device-backed keys and WebAuthn credentials.

Questions are welcome via Twitter @cardene777.

Other publications:

https://chaldene.net/