You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(cryptography): reviewer-suggested README intros and kit codecs in tests
Adopt amilz's beginner-friendly curve intros with links to the merged
SIMD-0302/0388 specs and EIP-197, and switch the TypeScript tests to
kit codecs: getBase16Codec for hex vectors and a struct codec spelling
out the aggregate-verify wire layout.
Copy file name to clipboardExpand all lines: cryptography/bls12-381/pinocchio/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
# BLS12-381 curve operations (Pinocchio)
2
2
3
-
A stateless program that wraps the BLS12-381 group operations of the `sol_curve_group_op` syscall. Results come back as transaction return data. Points are big-endian: G1 = 96 bytes, G2 = 192 bytes; scalars are 32 bytes big-endian and go first in the instruction data.
3
+
BLS12-381 is a modern elliptic curve designed for _pairings_ — a special operation that powers short aggregate signatures (many signers, one small signature to check) and zero-knowledge proofs, and it's the curve Ethereum and Solana's upcoming consensus both rely on. The underlying point math (adding two points, subtracting, or multiplying a point by a number) is far too expensive to run in ordinary program code without exhausting Solana's compute budget, so the runtime exposes it as a native building block: the `sol_curve_group_op` syscall. This example is a thin, stateless wrapper over that syscall — you pass in points and scalars, it returns the result as transaction return data — so you can see the raw curve operations by themselves before combining them into something like signature verification.
4
+
5
+
Learn more: [Solana's BLS12-381 syscall spec (SIMD-0388)](https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0388-bls12-381-syscalls.md) · [BLS12-381 for the rest of us (a beginner-friendly explainer)](https://hackmd.io/@benjaminion/bls12-381)
6
+
7
+
Points are big-endian: G1 = 96 bytes, G2 = 192 bytes; scalars are 32 bytes big-endian and go first in the instruction data.
Copy file name to clipboardExpand all lines: cryptography/bn254/pinocchio/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# BN254 (alt_bn128) operations (Pinocchio)
2
2
3
-
A stateless program that wraps the BN254 (alt_bn128) G2 group operations added by [SIMD-0302](https://github.com/solana-foundation/solana-improvement-documents/pull/302) and the pairing operation, via the `sol_alt_bn128_group_op` syscall. Results come back as transaction return data.
3
+
BN254 is an elliptic curve — a set of points you can "add" and "multiply" using special math. What makes it useful is its _pairing_: an operation that relates points in a way ordinary addition can't, and that's the engine behind things like zero-knowledge proofs and BLS signatures (many signers collapse into one tiny signature that verifies in a single check). This curve math is far too expensive to run in normal program code without blowing past Solana's compute budget, so the runtime provides it as a native building block — the `sol_alt_bn128_group_op` syscall. This example is a thin, stateless wrapper over that syscall: it hands your points and scalars to the runtime and returns the result as transaction return data, so you can see exactly what goes in and comes out before building anything larger on top.
0 commit comments