Changelog
1.4.0 - 2024-06-25
Gadgets.SHA256
. https://github.com/o1-labs/o1js/pull/1689 @Shigoto-dev19DynamicProof
class. https://github.com/o1-labs/o1js/pull/1688
FeatureFlags
is now exported and provides a set of helper functions to compute feature flags correctly.MerkleMap.computeRootAndKey()
deprecated in favor of MerkleMap.computeRootAndKeyV2()
due to a potential issue of computing hash collisions in key indicies https://github.com/o1-labs/o1js/pull/1694Changelog
1.3.1 - 2024-06-11
Experimental.OffchainState
implementation https://github.com/o1-labs/o1js/pull/1672
OffchainState
offchainState.commitments()
to initialize the state commitments onchain. Using OffchainStateCommitments.empty()
no longer works.Experimental.IndexedMerkleMap
, a better primitive for Merkleized storage https://github.com/o1-labs/o1js/pull/1666 https://github.com/o1-labs/o1js/pull/1671
MerkleMap
MerkleTree
and MerkleMap
, IndexedMerkleMap
has a high-level API that can be used in provable codeEcdsa.verifyV2()
and Ecdsa.verifySignedHashV2
methods to the Ecdsa
class. https://github.com/o1-labs/o1js/pull/1669Int64.isPositive()
and Int64.mod()
deprecated because they behave incorrectly on -0
https://github.com/o1-labs/o1js/pull/1660
+0
or the -0
representationInt64.isPositiveV2()
and Int64.modV2()
insteadInt64.neg()
in favor of Int64.negV2()
, for compatibility with v2 version of Int64
that will use Int64.checkV2()
Ecdsa.verify()
and Ecdsa.verifySignedHash()
deprecated in favor of Ecdsa.verifyV2()
and Ecdsa.verifySignedHashV2()
due to a security vulnerability found in the current implementation https://github.com/o1-labs/o1js/pull/1669Changelog
1.3.0 - 2024-05-23
base64Encode()
and base64Decode(byteLength)
methods to the Bytes
class. https://github.com/o1-labs/o1js/pull/1659method.returns(Type)
, to require a matching return signature https://github.com/o1-labs/o1js/pull/1653Struct.empty()
returning a garbage object when one of the base types doesn't support empty()
https://github.com/o1-labs/o1js/pull/1657Option.value_exn None
error when using certain custom gates in combination with recursion https://github.com/o1-labs/o1js/issues/1336 https://github.com/MinaProtocol/mina/pull/15588Changelog
1.2.0 - 2024-05-14
Experimental.OffchainState
https://github.com/o1-labs/o1js/pull/1630 https://github.com/o1-labs/o1js/pull/1652
Option
for defining an optional version of any provable type https://github.com/o1-labs/o1js/pull/1630MerkleTree.clone()
and MerkleTree.getLeaf()
, new convenience methods for merkle trees https://github.com/o1-labs/o1js/pull/1630MerkleList.forEach()
, a simple and safe way for iterating over a MerkleList
Unconstrained.provableWithEmpty()
to create an unconstrained provable type with a known empty()
value https://github.com/o1-labs/o1js/pull/1630Permissions.VerificationKey
, a namespace for verification key permissions https://github.com/o1-labs/o1js/pull/1639
impossible
and proof
permissions for verification keys, which are now called impossibleDuringCurrentVersion
and proofDuringCurrentVersion
respectively.State()
now optionally accepts an initial value as input parameter https://github.com/o1-labs/o1js/pull/1630
@state(Field) x = State(Field(1));
init()
methodinit()
method to set initial valuesChangelog
1.1.0 - 2024-04-30
DynamicProof
that allows verification through specifying a verification key in-circuitProvable.witnessFields()
to easily witness a tuple of field elements https://github.com/o1-labs/o1js/pull/1229Gadgets.rangeCheck64()
now returns individual range-checked limbs for advanced use cases https://github.com/o1-labs/o1js/pull/1229UInt64.rightShift()
where it incorrectly performed a left shift instead of a right shift. https://github.com/o1-labs/o1js/pull/1617ForeignField.toBits()
where high limbs were under-constrained for input length less than 176. https://github.com/o1-labs/o1js/pull/1617dummyBase64Proof()
lazy. Significant speed up when generating many account updates with authorization Proof
while proofs turned off. https://github.com/o1-labs/o1js/pull/1624Changelog
1.0.1 - 2024-04-22
Scalar
from 255 Bools to 1 Bool and 1 Field (low bit and high 254 bits)Group.scale()
support all scalars (previously did not support 0, 1 and -1)Group.scale()
directly accept Field
elements, and much more efficient than previous methods of scaling by Fields
Signature.verify()
and Nullifier.verify()
use much fewer constraintsScalar.fromBits()
to not produce a shifted scalar; shifting is no longer exposed to users of Scalar
.Mina.LocalBlockchain()
and Proof.fromJSON()
are made async https://github.com/o1-labs/o1js/pull/1583
Mina.LocalBlockchain
no longer supports the network kind configuration https://github.com/o1-labs/o1js/pull/1581Poseidon.hashToGroup()
now returns a Group
directly, and constrains it to be deterministic https://github.com/o1-labs/o1js/pull/1546
Poseidon.Unsafe.hashToGroup()
as a more efficient, non-deterministic version for advanced use casesTransaction
's prove
method no longer returns the proofs promise directly, but rather returns a Transaction
promise, the resolved value of which contains a proofs
prop. https://github.com/o1-labs/o1js/pull/1567Transaction
type now has two type params Proven extends boolean
and Signed extends boolean
, which are used to conditionally show/hide relevant state. https://github.com/o1-labs/o1js/pull/1567MerkleList
and MerkleListIterator
for easier traversal of MerkleList
s. https://github.com/o1-labs/o1js/pull/1562contract.getActions()
now returns a MerkleList
toValue()
and fromValue()
interface to Provable<T>
to encode how provable types map to plain JS values https://github.com/o1-labs/o1js/pull/1271
Provable.witness()
callback, and it will be transformed into the provable typeAccount()
constructor which was no different from AccountUpdate.create().account
, and export Account
type instead. https://github.com/o1-labs/o1js/pull/1598Events
under AccountUpdate.Events
. https://github.com/o1-labs/o1js/pull/1563Mina.transaction
has been reworked such that one can call methods directly on the returned promise (now a TransactionPromise
). This enables a fluent / method-chaining API. https://github.com/o1-labs/o1js/pull/1567TransactionPendingPromise
enables calling wait
directly on the promise returned by calling send
on a Transaction
. https://github.com/o1-labs/o1js/pull/1567initializeBindings()
to explicitly trigger setup work that is needed when running provable code https://github.com/o1-labs/o1js/pull/1583
MerkleTree.{nodes,zeroes}
public properties https://github.com/o1-labs/o1js/pull/1555
toBits()
change https://github.com/o1-labs/o1js/pull/1559Changelog
0.18.0 - 2024-04-09
await
inside your methods. Change the method signature by adding the async
keyword.await
to all contract calls! await MyContract.myMethod();
@method.returns()
decoratorMina.transaction()
to be async https://github.com/o1-labs/o1js/pull/1468{SmartContract,ZkProgram}.analyzeMethods()
to be async https://github.com/o1-labs/o1js/pull/1450
Provable.runAndCheck()
, Provable.constraintSystem()
and {SmartContract,ZkProgram}.digest()
are also async nowCircuitValue
, prop
, arrayProp
and matrixProp
https://github.com/o1-labs/o1js/pull/1507Mina.accountCreationFee()
, Mina.BerkeleyQANet
, all APIs which accept private keys for feepayers, Token
, AccountUpdate.tokenSymbol
, SmartContract.{token, setValue, setPermissions}
, "assert" methods for preconditions, MerkleTee.calculateRootSlow()
, Scalar.fromBigInt()
, UInt64.lt()
and friends, deprecated static methods on Group
, utility methods on Circuit
like Circuit.if()
, Field.isZero()
, isReady
and shutdown()
https://github.com/o1-labs/o1js/pull/1515privateKey
from the accepted arguments of SmartContract.deploy()
https://github.com/o1-labs/o1js/pull/1515Field
comparisons and massively reduce their constraints https://github.com/o1-labs/o1js/pull/1523
Field.assertLessThan()
goes from 510 to 24 constraints, Field.lessThan()
from 509 to 38UInt64.assertLessThan()
from 27 to 14, UInt64.lessThan()
from 27 to 15, UInt32
similar.Field.isEven()
, add Field.isOdd()
PrivateKey.toPublicKey()
from 358 to 119 constraints thanks to isOdd()
Gadgets.ForeignField.assertLessThanOrEqual()
and support two variables as input to ForeignField.assertLessThan()
this.sender
which unintuitively did not prove that its value was the actual sender of the transaction https://github.com/o1-labs/o1js/pull/1464 @julio4
Replaced by more explicit APIs:
this.sender.getUnconstrained()
which has the old behavior of this.sender
, and returns an unconstrained value (which means that the prover can set it to any value they want)this.sender.getAndRequireSignature()
which requires a signature from the sender's public key and therefore proves that whoever created the transaction really owns the sender accountReducer.reduce()
requires the maximum number of actions per method as an explicit (optional) argument https://github.com/o1-labs/o1js/pull/1450
new UInt64()
and UInt64.from()
no longer unsafely accept a field element as input. https://github.com/o1-labs/o1js/pull/1438 @julio4UInt64.Unsafe.fromField()
was introduced
UInt64
without proving that it fits in 64 bitsUInt32
Field.to/fromBits()
outlined in #1023 by imposing a limit of 254 bits https://github.com/o1-labs/o1js/pull/1461Field.rangeCheckHelper()
which was too low-level and easy to misuse https://github.com/o1-labs/o1js/pull/1485
Gadgets.isInRangeN()
to Gadgets.isDefinitelyInRangeN()
Bool.Unsafe.ofField()
to Bool.Unsafe.fromField()
https://github.com/o1-labs/o1js/pull/1485Gadgets.Field3
and Gadgets.ForeignField.Sum
with Field3
and ForeignFieldSum
Gadgets.rangeCheck3x12()
and fix proof system bug that prevented it from working https://github.com/o1-labs/o1js/pull/1534Provable.witnessAsync()
to introduce provable values from an async callback https://github.com/o1-labs/o1js/pull/1468toInput
method for Group
instance https://github.com/o1-labs/o1js/pull/1483field.assertBool()
now also returns the Field
as a Bool
for ergonomics https://github.com/o1-labs/o1js/pull/1523Changelog
0.17.0 - 2024-03-06
Mina.LocalBlockchain
and Mina.Network
to have the same behaviors https://github.com/o1-labs/o1js/pull/1422 https://github.com/o1-labs/o1js/pull/1480
TransactionId
type to Transaction
. Additionally added PendingTransaction
and RejectedTransaction
types to better represent the state of a transaction.Transaction.safeSend()
and PendingTransaction.safeWait()
are introduced to return a IncludedTransaction
or RejectedTransaction
object without throwing errors.transaction.send()
throws an error if the transaction was not successful for both Mina.LocalBlockchain
and Mina.Network
and returns a PendingTransaction
object if it was successful. Use transaction.safeSend
to send a transaction that will not throw an error and either return a PendingTransaction
or RejectedTransaction
.transaction.wait()
throws an error if the transaction was not successful for both Mina.LocalBlockchain
and Mina.Network
and returns a IncludedTransaction
object if it was successful. Use transaction.safeWait
to send a transaction that will not throw an error and either return a IncludedTransaction
or RejectedTransaction
.transaction.hash()
is no longer a function, it is now a property that returns the hash of the transaction.Transaction.isSuccess
to Transaction.status
to better represent the state of a transaction.AccountUpdate.callData
by packing field elements into as few field elements as possible https://github.com/o1-labs/o1js/pull/1458
Bool
s)LocalBlockchain
in reverse chronological order (latest events at the beginning) to match the behavior of the Network
https://github.com/o1-labs/o1js/pull/1460mainnet
or testnet
https://github.com/o1-labs/o1js/pull/1444PrivateKey.randomKeypair()
to generate private and public key in one command https://github.com/o1-labs/o1js/pull/1446setNumberOfWorkers()
to allow developer to override the number of workers used during compilation and proof generation/verification https://github.com/o1-labs/o1js/pull/1456fetchActions
/fetchEvents
with a missing Archive Node endpoint https://github.com/o1-labs/o1js/pull/1459SmartContract.token
is deprecated in favor of new methods on TokenContract
https://github.com/o1-labs/o1js/pull/1446
TokenContract.deriveTokenId()
to get the ID of the managed tokenTokenContract.internal.{send, mint, burn}
to perform token operations from within the contractCircuit
handle types with a .provable
property (like those used in ECDSA) https://github.com/o1-labs/o1js/pull/1471
Changelog
AccountUpdate.children
and AccountUpdate.parent
properties https://github.com/o1-labs/o1js/pull/1402
AccountUpdatesLayout
argument to approve()
AccountUpdateTree
and AccountUpdateForest
, new classes that represent a layout of account updates explicitlyapprove()
accountUpdate.extractTree()
to obtain the tree associated with an account update in the current transaction context.Experimental.Callback
API https://github.com/o1-labs/o1js/pull/1430MerkleList<T>
to enable provable operations on a dynamically-sized list https://github.com/o1-labs/o1js/pull/1398
MerkleListIterator<T>
to iterate over a merkle listTokenContract
, a new base smart contract class for token contracts https://github.com/o1-labs/o1js/pull/1384
https://github.com/o1-labs/o1js/blob/main/src/lib/mina/token/token-contract.unit-test.ts
TokenAccountUpdateIterator
, a primitive to iterate over all token account updates in a transaction https://github.com/o1-labs/o1js/pull/1398
TokenContract
under the hood