Explore crypto primitives in o1js
mainThe src/examples/crypto/ directory contains implementation examples for advanced cryptographic primitives that can be used within provable o1js code. These examples demonstrate how to handle operations that fall outside the standard field arithmetic of the Mina blockchain.
Available examples include:
- Non-native field arithmetic: Using
foreign-field.tsto perform arithmetic on fields other than the native Mina field. - Non-native ECDSA verification: Using
ecdsa.tsto verify Elliptic Curve Digital Signature Algorithm signatures. - Provable big integer arithmetic: Using
bigint.tsfor arithmetic involving large integers. - RSA signature verification: A low-level implementation found in the
rsa/directory, which utilizes a custombiginttype optimized with efficient o1js range checks.