Skip to content

Commit

Permalink
Add precompile page
Browse files Browse the repository at this point in the history
  • Loading branch information
danyalprout committed Apr 24, 2024
1 parent 91b24a9 commit 0d22959
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions specs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [Batch Submitter](./protocol/batcher.md)
- [Predeploys](./protocol/predeploys.md)
- [Preinstalls](./protocol/preinstalls.md)
- [Precompiles](./protocol/precompiles.md)
- [Superchain]()
- [Superchain Configuration](./protocol/superchain-configuration.md)
- [Superchain Upgrades](./protocol/superchain-upgrades.md)
Expand Down
11 changes: 11 additions & 0 deletions specs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Chain Re-Organization](#chain-re-organization)
- [Predeployed Contract ("Predeploy")](#predeployed-contract-predeploy)
- [Preinstalled Contract ("Preinstall")](#preinstalled-contract-preinstall)
- [Precompiled Contract ("Precompile")](#precompiled-contract-precompile)
- [Receipt](#receipt)
- [Transaction Type](#transaction-type)
- [Fork Choice Rule](#fork-choice-rule)
Expand Down Expand Up @@ -149,6 +150,16 @@ available to improve the L2's UX.

All preinstall contracts are specified in the [preinstalls specification](./protocol/preinstalls.md).

## Precompiled Contract ("Precompile")

[predeploy]: glossary.md#precompiled-contract-precompile

A contract implemented natively in the EVM that performs a specific operation more efficiently than a bytecode
(e.g. Solidity) implementation. Precompiles exist at predefined addresses. They are created and modified through
network upgrades.

All precompile contracts are specified in the [precompiles specification](./protocol/precompiles.md).

## Receipt

[receipt]: glossary.md#receipt
Expand Down
36 changes: 36 additions & 0 deletions specs/protocol/precompiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Precompiles

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Overview](#overview)
- [P256VERIFY](#p256verify)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Overview

[Precompiled contracts](../glossary.md#precompiled-contract-precompile) exist on OP-Stack chains at
predefined addresses. They are similar to predeploys but are implemented as native code in the EVM as opposed to
bytecode. Precompiles are used for computationally expensive operations, that would be cost prohibitive to implement
in Solidity. Where possible predeploys are preferred, as precompiles must be implemented in every execution client.

OP-Stack chains contain the [standard Ethereum precompiles](https://www.evm.codes/precompiled) as well as a small
number of additional precompiles. The following table lists each of the additional precompiles. The system version
indicates when the precompile was introduced.

| Name | Address | Introduced |
|------------| ------------------------------------------ |------------|
| P256VERIFY | 0x0000000000000000000000000000000000000100 | Fjord |

## P256VERIFY

The `P256VERIFY` precompile performs signature verification for the secp256r1 elliptic curve. This curve has widespread
adoption. It's used by Passkeys, Apple Secure Enclave and many other systems.

It is specified as part of [RIP-7212](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md) and was added to
the OP-Stack protocol in the Fjord release. The op-geth implementation is
[here](https://github.com/ethereum-optimism/op-geth/blob/optimism/core/vm/contracts.go#L1161-L1193).

Address: `0x0000000000000000000000000000000000000100`

0 comments on commit 0d22959

Please sign in to comment.