SIMD-0284

Alt-BN128 Little Endian compatibility

Author: Dean Little - Blueshift · Category: Core Protocol GitHub →

TL;DR

Extend the Alt-BN128 syscalls to add little endian support.

Summary

Extend the Alt-BN128 syscalls to add little endian support.

Motivation

All prominent ZK teams on Solana primarily use Rust with ark-bn254 in their workflows; the same crate used in the Alt-BN128 syscalls implementation in agave. The original implementor designed the syscalls to mimic the functionality of Ethereum which encodes uint256 values in Big Endian. This creates an unnecessarily complicated API for anyone trying to build zero knowledge proofs on Solana leading to many wasted hours of debugging endianness and encoding issues. As it's relatively easy to fix, we should do something about it.

Impact

Working with ZK proofs will become much easier, as the most widely-used tooling and the system API will finally be compatible without any additional work or confusion.

Security Considerations

None