secp256r1, is widely supported by secure elements, TPMs, passkeys, mobile secure enclaves, and industrial hardware. On peaq, you can use it to verify that a machine action was signed by the private key associated with an enrolled P-256 public key.
P-256 verification is available on peaq mainnet (chain ID 3338) today. The audited Daimo verifier is deployed at
0xc2b78104907F722DABAc4C69f826a522B2754De4.
How verification works
- A machine hashes an action and signs the hash with a P-256 private key held by its secure hardware.
- The application checks its policy, including the active public key, chain ID, nonce, expiry, and revocation status.
- A smart contract verifies the signature onchain.
- The application authorizes the requested payment, command, access, or data operation.
Choose an integration path
Gas usage varies with compiler settings and input data. Do not call
0x100 on peaq until the precompile is announced as live.
Use OpenZeppelin P256
OpenZeppelin Contracts 5.1 or later provides a portableP256.verify() function. It checks for the RIP-7212 precompile and falls back to its Solidity implementation when the precompile is unavailable.
P256Example.sol
Call the mainnet verifier directly
The Daimo singleton accepts the RIP-7212-shaped 160-byte payload directly. There is no function selector or ABI wrapper.PeaqP256Verifier.sol
0 for an invalid signature, while a conforming RIP-7212 precompile returns empty output.
Build the 160-byte input
Concatenate five 32-byte, big-endian fields in this exact order:
Before submitting the payload:
- Decode DER signatures into raw
randsvalues. - Remove the
0x04prefix from an uncompressed SEC1 public key. Decompress compressed keys offchain. - Confirm the stored public key is active for the machine and the requested action.
Verify through an RPC call
Useeth_call when verification is needed offchain. It executes the verifier without submitting a transaction or spending gas.
ethers.ts
Production checklist
- Bind each public key to the intended machine identity through an authenticated enrollment flow.
- Include the application domain, peaq chain ID, action, nonce, and expiry in the signed data.
- Store or invalidate nonces to prevent replay attacks.
- Define key rotation and revocation before accepting signatures in production.
- Do not use signature bytes as a unique identifier; P-256 signatures can be malleable.
- Require hardware attestation when you need proof of device provenance, not only proof of key possession.

