Add draft TIP: Native BN254 Precompiles via Rust FFI#847
Add draft TIP: Native BN254 Precompiles via Rust FFI#847anishnarang9 wants to merge 1 commit intotronprotocol:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new draft VM TIP proposing a Rust FFI–backed native BN254 precompile implementation for addresses 0x06, 0x07, and 0x08, aligning calldata semantics with EIP-196/EIP-197 and specifying deterministic governance activation.
Changes:
- Introduces a draft TIP describing native BN254 precompiles and their calldata/validation semantics.
- Defines governance activation behavior via a committee parameter and maintenance-period boundary rules.
- Documents benchmark and proof-validation evidence with links to companion materials.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
| tip: <to be assigned> | ||
| title: Native BN254 Precompiles via Rust FFI | ||
| author: Anish Narang (@anishnarang9), Blockchain@Maryland | ||
| discussions-to: https://github.com/tronprotocol/tips/issues/846 | ||
| status: Draft | ||
| type: Standards Track | ||
| category: VM | ||
| created: 2026-03-24 | ||
| --- |
There was a problem hiding this comment.
The TIP front-matter is using YAML-style --- delimiters. In this repository, TIP metadata blocks are consistently wrapped in a fenced code block (...), per template.md. Please switch to the fenced-code metadata format to match existing TIP conventions and tooling expectations.
| | Operation | Java (current generic path) | Rust (proposed path) | Speedup | | ||
| |-----------|-----------------------------|----------------------|---------| | ||
| | ecAdd (`0x06`) | `93 us` | `5 us` | **18.6x** | | ||
| | ecMul (`0x07`) | `4,606.5 us` | `63.8 us` | **72.2x** | | ||
| | ecPairing (`0x08`) | `98,203 us` | `1,406.8 us` | **69.8x** | | ||
|
|
There was a problem hiding this comment.
Markdown table rows here start with || (double leading pipe), which renders as an extra empty column in GitHub-flavored Markdown. Replace the leading || with a single | for correct table formatting.
| | Address | Operation | Input | Output | | ||
| |---------|-----------|-------|--------| | ||
| | `0x06` | BN254 G1 Addition | two G1 points | one G1 point | | ||
| | `0x07` | BN254 G1 Scalar Multiplication | one G1 point and one scalar | one G1 point | | ||
| | `0x08` | BN254 Pairing Check | `k` G1/G2 pairs | 32-byte boolean | | ||
|
|
There was a problem hiding this comment.
The "Precompile Addresses" table uses || at the start of rows, which renders with an unintended extra blank column on GitHub. Use a single leading | for each row.
| | Operation | Energy Cost | Ethereum Gas (EIP-1108) | | ||
| |-----------|-------------|--------------------------| | ||
| | ecAdd | `150` | `150` | | ||
| | ecMul | `6,000` | `6,000` | | ||
| | ecPairing | `80,000 * k + 100,000` | `34,000 * k + 45,000` | | ||
|
|
There was a problem hiding this comment.
The "Energy Costs" table also uses || prefixes, which breaks GitHub table rendering by adding an empty first column. Please change these rows to start with a single |.
| | Application Class | Why This Matters | | ||
| |-------------------|------------------| | ||
| | ZK rollups | Batch-validity verification depends on practical pairing performance | | ||
| | Shielded transfer systems | Merkle-membership and nullifier-style Groth16 verification becomes viable on the generic path | | ||
| | Cross-chain zk verification | On-chain proof verification becomes feasible without the current generic-path timeout profile | | ||
| | Identity / credential proofs | Generic BN254 verifiers become realistic building blocks instead of benchmark-only experiments | | ||
| | Verifiable computation | Generic Groth16 proof verification becomes part of the usable VM surface | | ||
|
|
There was a problem hiding this comment.
The "What This Unlocks" table is formatted with double leading pipes (||), which renders with an unintended extra empty column on GitHub. Update the table rows to start with a single |.
Summary
0x06,0x07, and0x08Discussion
Companion Material