Skip to main content
Technical proposal SIMD-0222 Implemented

Fix alt-bn128 multiplication syscall length

  1. Idea
  2. Draft
  3. Review
  4. Accept
  5. Implement
  6. Active

Decision brief

Why this proposal matters

The alt_bn128_multiplication syscall takes in a byte slice as input, interprets the bytes as a bn128 elliptic curve point/scalar pair, and applies point-scalar multiplication. If the byte slice input has improper length then the function terminates early. Specifically, if the byte slice has length greater than 128, then the function terminates early with an error. However, a bn128 curve point is 64 bytes and a scalar is 32 bytes. This means that the function should check if the byte slice is 96 bytes in length rather than 128 bytes. This document proposes to fix this length check by checking for the correct length.

Source-backed reading aid · source language: EN

Proposal at a glance

What changes

  • The alt_bn128_multiplication syscall takes in a byte slice as input, interprets the bytes as a bn128 elliptic curve point/scalar pair, and applies point-scalar multiplication. If the byte slice input has improper length then the function terminates early.…

Stakeholder map

Who is affected

Builders & client teams Medium impact

This fix will prevent accidental misuse of the alt_bn128_multiplication syscall function and make programs easier to debug.

Action requirement unknown
Validators & operators Impact unknown

No proposal-specific evidence was found for this group.

Action requirement unknown
Users & stakers Impact unknown

No proposal-specific evidence was found for this group.

Action requirement unknown
Governance & ecosystem Impact unknown

No proposal-specific evidence was found for this group.

Action requirement unknown

Exact source revision

Full proposal document

Source-language document. Technical identifiers and evidence remain unchanged. 0616093b2952

Summary

The alt_bn128_multiplication syscall takes in a byte slice as input, interprets the bytes as a bn128 elliptic curve point/scalar pair, and applies point-scalar multiplication. If the byte slice input has improper length then the function terminates early. Specifically, if the byte slice has length greater than 128, then the function terminates early with an error.

However, a bn128 curve point is 64 bytes and a scalar is 32 bytes. This means that the function should check if the byte slice is 96 bytes in length rather than 128 bytes.

This document proposes to fix this length check by checking for the correct length.

Motivation

The alt_bn128_multiplication function still works with the incorrect 128 length bound since a correct input of 96 bytes is still less than 128 bytes. However, there could be successful inputs that are greater than 96 bytes and smaller than 128 bytes in length. This could cause application logic harder to debug.

Alternatives Considered

Leave as is.

New Terminology

N/A

Detailed Design

The fix is simple.

Currently, the constant ALT_BN128_MULTIPLICATION_INPUT_LEN, which is set to 128 is used to sanity check the length of the input.


pub fn alt_bn128_multiplication(input: &[u8]) -> Result<Vec<u8>, AltBn128Error> {
    if input.len() > ALT_BN128_MULTIPLICATION_INPUT_LEN {
        return Err(AltBn128Error::InvalidInputData);

    // logic omitted...
}

A fix would entail updating the ALT_BN128_MULTIPLICATION_INPUT_LEN constant to the correct length of 96.

Impact

This fix will prevent accidental misuse of the alt_bn128_multiplication syscall function and make programs easier to debug.

Security Considerations

This does update the behavior of the syscall function and therefore, should be properly feature-gated.

Drawbacks (Optional)

None

Evidence graph

Related proposals and rollout

One or more sources are unavailable.

Upstream review record

Upstream discussion & review

GitHub review is editorial context, not evidence of on-chain support, voting, or outcome.

PR #222 · merged SIMD-0222: Fix alt-bn128-multiplication Syscall Length Check 1 comments and reviews · Jan 26, 2026
@joncinque

Since this has approval from both Firedancer and Anza, I will give one more week for objections before merging.

GitHub ↗

simd.watch community discussion · SIMD-0222

Powered by Giscus · Sign in with GitHub to comment

Community comments load when this section approaches the viewport.

Provenance

Evidence & technical details

Rollout or chain data, source revisions, freshness and integrity.
1

SIMD

Deployment Status

Document lifecycleImplemented
CategoryCore protocol
Devnetactive Epoch 920
Testnetactive Epoch 816
Mainnet-Betaactive Epoch 836
bn2puAyxUx6JUabAxYdKdJ5QHbNNmKw8dCGuGCyRrFN

Exact source revision

Sources & integrity

  • Proposal document pinned_commit_blob
    0616093b2952ed6de52c4a27d66aadd11d48d4f9
  • simd-document document · current · Sep 11, 2026
    0616093b2952ed6de52c4a27d66aadd11d48d4f9

One or more sources are unavailable.