Changelog
2.2.0 - 2024-12-10
ZkProgram
to support non-pure provable types as inputs and outputs https://github.com/o1-labs/o1js/pull/1828enforceTransactionLimits
parameter on Network https://github.com/o1-labs/o1js/issues/1910SmartContract
or ZkProgram
to 30. https://github.com/o1-labs/o1js/pull/1918Proof.{_proofToBase64,_proofFromBase64}
https://github.com/o1-labs/o1js/pull/1928rangeCheck16
gadget https://github.com/o1-labs/o1js/pull/1920Changelog
divMod32()
gadget was modified to accept nBits
instead of quotientBits
, and assert it is in the range [0, 2**255) to address an issue previously where the bound on quotientBits
was too low https://github.com/o1-labs/o1js/pull/1763.Provable.equal()
now turns both types into canonical form before comparing them https://github.com/o1-labs/o1js/pull/1759
Provable.equal(x, y)
where you didn't have to pass in the typeTokenContractV2
to TokenContract
with a correct amount of maximum account updates.ZkProgram
methods now support auxiliaryOutput
. https://github.com/o1-labs/o1js/pull/1809
auxiliaryOutput
toCanonical()
in the Provable<T>
interface to protect against incompleteness of certain operations on malicious witness inputs https://github.com/o1-labs/o1js/pull/1759divMod64()
division modulo 2^64 that returns the remainder and quotient of the operationaddMod64()
addition modulo 2^64{UInt32, UInt64}.or()
Changelog
1.9.0 - 2024-10-15
VerificationKey.dummy()
method to get the dummy value of a verification key https://github.com/o1-labs/o1js/pull/1852 @rpanicProof
a normal provable type, that can be witnessed and composed into Structs https://github.com/o1-labs/o1js/pull/1847, https://github.com/o1-labs/o1js/pull/1851
SelfProof
can still not be nested because it needs special treatmentChangelog
1.8.0 - 2024-09-18
verifyEthers
method to verify Ethereum signatures using the EIP-191 message hashing standard. https://github.com/o1-labs/o1js/pull/1815
fromEthers
method for parsing and converting Ethereum public keys into ForeignCurve
points, supporting both compressed and uncompressed formats.fromHex
method for converting hexadecimal strings into ForeignCurve
points.myProgram.setProofsEnabled(false)
wouldn't work when called before myProgram.compile()
. https://github.com/o1-labs/o1js/pull/1827state.fetch()
for custom token contracts. @rpanic https://github.com/o1-labs/o1js/pull/1853Changelog
1.7.0 - 2024-09-04
Encryption.encryptV2()
and Encryption.decryptV2()
for an updated encryption algorithm that guarantees cipher text integrity.
Encryption.encryptBytes()
and Encryption.decryptBytes()
using the same algorithm.proofsEnabled
for zkProgram
(default value: true
), to quickly test circuit logic with proofs disabled https://github.com/o1-labs/o1js/pull/1805
MyProgram.proofsEnabled
to get the internal value of proofsEnabled
and MyProgram.setProofsEnabled(proofsEnabled)
to set the value dynamically.this.sender.getAndRequireSignature()
/ getUnconstrained()
deprecated in favor of V2
versions due to a vulnerability https://github.com/o1-labs/o1js/pull/1799Int64.modV2()
when the input is negative and the remainder should be 0 https://github.com/o1-labs/o1js/pull/1797Changelog
1.6.0 - 2024-07-23
SmartContract.emitEventIf()
to conditionally emit an event https://github.com/o1-labs/o1js/pull/1746Encryption.encryptV2()
and Encryption.decryptV2()
for an updated encryption algorithm that guarantees cipher text integrity.
Encryption.encryptBytes()
and Encryption.decryptBytes()
using the same algorithm.xor
, not
, and and
, operations from 254 to 240 bits to prevent overflow vulnerabilities. https://github.com/o1-labs/o1js/pull/1745Type
instead of Type.provable
in APIs that expect a provable type https://github.com/o1-labs/o1js/pull/1751
Provable.witness(Bytes32, () => bytes)
Unconstrained
in fromValue
and toValue
, so that we don't need to deal with "unconstrained" values outside provable code https://github.com/o1-labs/o1js/pull/1751Changelog
1.5.0 - 2024-07-09
OffchainState
where it didn't store the IndexedMerkleTree
length onchain and left it unconstrained https://github.com/o1-labs/o1js/pull/1676ForeignField
-based representation of scalars via ScalarField
https://github.com/o1-labs/o1js/pull/1705isUnusedV2()
, assertUnusedV2()
, and setUsedV2()
https://github.com/o1-labs/o1js/pull/1715Int64.create()
method for safe instance creation with canonical zero representation https://github.com/o1-labs/o1js/pull/1735Int64
operations: fromObjectV2
, divV2()
https://github.com/o1-labs/o1js/pull/1735Experimental.BatchReducer
to reduce actions in batches https://github.com/o1-labs/o1js/pull/1676
.requireEqualsIf()
https://github.com/o1-labs/o1js/pull/1676AccountUpdate.createIf()
to conditionally add an account update to the current transaction https://github.com/o1-labs/o1js/pull/1676IndexedMerkleMap.setIf()
to set a key-value pair conditionally https://github.com/o1-labs/o1js/pull/1676Provable.assertEqualIf()
to conditionally assert that two values are equal https://github.com/o1-labs/o1js/pull/1676offchainState.setContractClass()
which enables us to declare the connected contract at the top level, without creating a contract instance https://github.com/o1-labs/o1js/pull/1676
offchainState.compile()
MerkleList
https://github.com/o1-labs/o1js/pull/1676
popIfUnsafe()
, toArrayUnconstrained()
and lengthUnconstrained()
Nullifier.isUnused()
, Nullifier.assertUnused()
, and Nullifier.setUsed()
methods https://github.com/o1-labs/o1js/pull/1715createEcdsa
, createForeignCurve
, ForeignCurve
and EcdsaSignature
deprecated in favor of V2
versions due to a security vulnerability found in the current implementation https://github.com/o1-labs/o1js/pull/1703Int64
constructor, recommending Int64.create()
instead https://github.com/o1-labs/o1js/pull/1735div()
and fromObject
, methods in favor of V2 versions https://github.com/o1-labs/o1js/pull/1735AccountUpdate.defaultAccountUpdate()
in favor of AccountUpdate.default()
https://github.com/o1-labs/o1js/pull/1676TokenContract.approveAccountUpdates()
https://github.com/o1-labs/o1js/pull/1722check()
method in Struct classes to properly handle inheritance, preventing issues with under-constrained circuits. Added error handling to avoid using Struct directly as a field type. https://github.com/o1-labs/o1js/pull/1707Option
could not be used as @state
or event https://github.com/o1-labs/o1js/pull/1736