Skip to main content

Overview

The P256 precompile provides a suite of cryptographic functions for the NIST P-256 elliptic curve. It enables smart contracts to perform essential operations such as signature verification, scalar multiplication, and point addition, which are fundamental for building secure and privacy-preserving applications. Precompile Address: 0x0000000000000000000000000000000000000100 Related Module: Core cryptographic functionality

Methods

verifySignature

Verifies a P-256 ECDSA signature against a hash and public key.

scalarMult

Performs scalar multiplication on the P-256 elliptic curve.

pointAdd

Adds two points on the P-256 elliptic curve.

getGenerator

Returns the generator point of the P-256 curve.

isOnCurve

Validates whether a given point lies on the P-256 curve.

compressPoint

Compresses a P-256 point to its 33-byte representation.

decompressPoint

Decompresses a 33-byte compressed point to its full coordinates.

Example: Verifying a P-256 Signature

Example: Getting the Generator Point

Example: Scalar Multiplication

Full Solidity Interface & ABI

P256 Solidity Interface
P256 ABI