Skip to main content

Changelog

All notable changes to this project are documented in this file.

The format is based on Keep a Changelog. This project adheres to Semantic Versioning.

Unreleased

2.4.0 - 2025-04-01

Added

2.3.0

Added

Changed

Fixed

2.2.0 - 2024-12-10

Added

Changed

Fixed

2.1.0 - 2024-11-13

Added

Fixed

2.0.0

Breaking Changes

  • The 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
    • Removed implicit version Provable.equal(x, y) where you didn't have to pass in the type
  • The return signature of a zkProgram has changed. https://github.com/o1-labs/o1js/pull/1809
    • A zkProgram method must now explicitly define the return type of the method when the method has a public or auxiliary output defined.
    • The return type of a proven method has changed as a result of this.
  • Various breaking constraint changes in internal methods or circuits because of audit fix.
  • Removal of various deprecated methods and functions.
  • Promotion of TokenContractV2 to TokenContract with a correct amount of maximum account updates.

Added

  • ZkProgram methods now support auxiliaryOutput. https://github.com/o1-labs/o1js/pull/1809
    • Each program method now accepts an optional property auxiliaryOutput
    • Auxiliary output is additional output that the zkProgram method returns
  • New method toCanonical() in the Provable<T> interface to protect against incompleteness of certain operations on malicious witness inputs https://github.com/o1-labs/o1js/pull/1759
  • divMod64() division modulo 2^64 that returns the remainder and quotient of the operation
  • addMod64() addition modulo 2^64
  • Bitwise OR via {UInt32, UInt64}.or()
  • BLAKE2B hash function gadget. https://github.com/o1-labs/o1js/pull/1767

1.9.1 - 2024-10-15

Fixes

1.9.0 - 2024-10-15

Added

Changed

Fixes

1.8.0 - 2024-09-18

Added

  • Added verifyEthers method to verify Ethereum signatures using the EIP-191 message hashing standard. https://github.com/o1-labs/o1js/pull/1815
    • Added fromEthers method for parsing and converting Ethereum public keys into ForeignCurve points, supporting both compressed and uncompressed formats.
    • Added fromHex method for converting hexadecimal strings into ForeignCurve points.

Fixes

1.7.0 - 2024-09-04

Added

  • Added Encryption.encryptV2() and Encryption.decryptV2() for an updated encryption algorithm that guarantees cipher text integrity.
    • Also added Encryption.encryptBytes() and Encryption.decryptBytes() using the same algorithm.
  • New option proofsEnabled for zkProgram (default value: true), to quickly test circuit logic with proofs disabled https://github.com/o1-labs/o1js/pull/1805
    • Additionally added MyProgram.proofsEnabled to get the internal value of proofsEnabled and MyProgram.setProofsEnabled(proofsEnabled) to set the value dynamically.

Deprecated

Fixes

1.6.0 - 2024-07-23

Added

  • SmartContract.emitEventIf() to conditionally emit an event https://github.com/o1-labs/o1js/pull/1746
  • Added Encryption.encryptV2() and Encryption.decryptV2() for an updated encryption algorithm that guarantees cipher text integrity.
    • Also added Encryption.encryptBytes() and Encryption.decryptBytes() using the same algorithm.

Changed

1.5.0 - 2024-07-09

Breaking changes

Added

Changed

Deprecated

Fixed

1.4.0 - 2024-06-25

Added

  • SHA256 low-level API exposed via Gadgets.SHA256. https://github.com/o1-labs/o1js/pull/1689 @Shigoto-dev19
  • Added the option to specify custom feature flags for sided loaded proofs in the DynamicProof class. https://github.com/o1-labs/o1js/pull/1688
    • Feature flags are required to tell Pickles what proof structure it should expect when side loading dynamic proofs and verification keys.
    • FeatureFlags is now exported and provides a set of helper functions to compute feature flags correctly.

Deprecated

1.3.1 - 2024-06-11

Breaking Changes

  • Improve efficiency of Experimental.OffchainState implementation https://github.com/o1-labs/o1js/pull/1672
    • Comes with breaking changes to the internal circuits of OffchainState
    • Also, introduce offchainState.commitments() to initialize the state commitments onchain. Using OffchainStateCommitments.empty() no longer works.

Added

Deprecated

  • Int64.isPositive() and Int64.mod() deprecated because they behave incorrectly on -0 https://github.com/o1-labs/o1js/pull/1660
    • This can pose an attack surface, since it is easy to maliciously pick either the +0 or the -0 representation
    • Use Int64.isPositiveV2() and Int64.modV2() instead
    • Also deprecated Int64.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/1669

Fixed

1.3.0 - 2024-05-23

Added

Fixes

1.2.0 - 2024-05-14

Added

Changed

  • State() now optionally accepts an initial value as input parameter https://github.com/o1-labs/o1js/pull/1630
    • Example: @state(Field) x = State(Field(1));
    • Initial values will be set in the default init() method
    • You no longer need a custom init() method to set initial values

Fixes

1.1.0 - 2024-04-30

Added

Changed

Fixed

1.0.1 - 2024-04-22

Breaking changes

  • Native curve improvements https://github.com/o1-labs/o1js/pull/1530
    • Change the internal representation of Scalar from 255 Bools to 1 Bool and 1 Field (low bit and high 254 bits)
    • Make Group.scale() support all scalars (previously did not support 0, 1 and -1)
    • Make Group.scale() directly accept Field elements, and much more efficient than previous methods of scaling by Fields
      • As a result, Signature.verify() and Nullifier.verify() use much fewer constraints
    • Fix Scalar.fromBits() to not produce a shifted scalar; shifting is no longer exposed to users of Scalar.
  • Add assertion to the foreign EC addition gadget that prevents degenerate cases https://github.com/o1-labs/o1js/pull/1545
    • Fixes soundness of ECDSA; slightly increases its constraints from ~28k to 29k
    • Breaks circuits that used EC addition, like ECDSA
  • Mina.LocalBlockchain() and Proof.fromJSON() are made async https://github.com/o1-labs/o1js/pull/1583
    • These were the last remaining sync APIs that depended on an async setup task; making them async enables removing top-level await
  • Mina.LocalBlockchain no longer supports the network kind configuration https://github.com/o1-labs/o1js/pull/1581
  • Poseidon.hashToGroup() now returns a Group directly, and constrains it to be deterministic https://github.com/o1-labs/o1js/pull/1546
    • Added Poseidon.Unsafe.hashToGroup() as a more efficient, non-deterministic version for advanced use cases
  • A Transaction'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/1567
  • The Transaction 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/1567
  • Improved functionality of MerkleList and MerkleListIterator for easier traversal of MerkleLists. https://github.com/o1-labs/o1js/pull/1562
  • Simplified internal logic of reducer. https://github.com/o1-labs/o1js/pull/1577
    • contract.getActions() now returns a MerkleList
  • Add 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
    • You can now return the plain value from a Provable.witness() callback, and it will be transformed into the provable type
  • Remove Account() constructor which was no different from AccountUpdate.create().account, and export Account type instead. https://github.com/o1-labs/o1js/pull/1598

Added

Changed

Fixed

0.18.0 - 2024-04-09

Breaking changes

  • Async circuits. Require all smart contract and zkprogram methods to be async https://github.com/o1-labs/o1js/pull/1477
    • This change allows you to use await inside your methods. Change the method signature by adding the async keyword.
    • Don't forget to add await to all contract calls! await MyContract.myMethod();
    • To declare a return value from a method, use the new @method.returns() decorator
  • Require the callback to Mina.transaction() to be async https://github.com/o1-labs/o1js/pull/1468
  • Change {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 now
  • Remove deprecated APIs
    • Remove CircuitValue, prop, arrayProp and matrixProp https://github.com/o1-labs/o1js/pull/1507
    • Remove Mina.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/1515
  • Remove privateKey from the accepted arguments of SmartContract.deploy() https://github.com/o1-labs/o1js/pull/1515
  • Efficient comparisons. Support arbitrary bit lengths for Field 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 38
    • Moderately improve other comparisons: UInt64.assertLessThan() from 27 to 14, UInt64.lessThan() from 27 to 15, UInt32 similar.
    • Massively improve Field.isEven(), add Field.isOdd()
    • PrivateKey.toPublicKey() from 358 to 119 constraints thanks to isOdd()
    • Add Gadgets.ForeignField.assertLessThanOrEqual() and support two variables as input to ForeignField.assertLessThan()
  • Remove 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 account
  • Reducer.reduce() requires the maximum number of actions per method as an explicit (optional) argument https://github.com/o1-labs/o1js/pull/1450
    • The default value is 1 and should work for most existing contracts
  • new UInt64() and UInt64.from() no longer unsafely accept a field element as input. https://github.com/o1-labs/o1js/pull/1438 @julio4 As a replacement, UInt64.Unsafe.fromField() was introduced
    • This prevents you from accidentally creating a UInt64 without proving that it fits in 64 bits
    • Equivalent changes were made to UInt32
  • Fixed vulnerability in Field.to/fromBits() outlined in #1023 by imposing a limit of 254 bits https://github.com/o1-labs/o1js/pull/1461
  • Remove Field.rangeCheckHelper() which was too low-level and easy to misuse https://github.com/o1-labs/o1js/pull/1485
    • Also, rename the misleadingly named Gadgets.isInRangeN() to Gadgets.isDefinitelyInRangeN()
  • Rename Bool.Unsafe.ofField() to Bool.Unsafe.fromField() https://github.com/o1-labs/o1js/pull/1485
  • Replace the namespaced type exports Gadgets.Field3 and Gadgets.ForeignField.Sum with Field3 and ForeignFieldSum
    • Unfortunately, the namespace didn't play well with auto-imports in TypeScript
  • Add Gadgets.rangeCheck3x12() and fix proof system bug that prevented it from working https://github.com/o1-labs/o1js/pull/1534
  • Update transaction version and other bindings changes to ensure berkeley compatibility https://github.com/o1-labs/o1js/pull/1542

Added

Changed

0.17.0 - 2024-03-06

Breaking changes

  • Fixed parity between 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
    • Changed the 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.
    • Changed Transaction.isSuccess to Transaction.status to better represent the state of a transaction.
  • Improved efficiency of computing AccountUpdate.callData by packing field elements into as few field elements as possible https://github.com/o1-labs/o1js/pull/1458
    • This leads to a large reduction in the number of constraints used when inputs to a zkApp method are many field elements (e.g. a long list of Bools)
  • Return events in the LocalBlockchain in reverse chronological order (latest events at the beginning) to match the behavior of the Network https://github.com/o1-labs/o1js/pull/1460

Added

Changed

Deprecated

  • SmartContract.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 token
    • TokenContract.internal.{send, mint, burn} to perform token operations from within the contract

Fixed

0.16.1

Breaking changes

  • Remove AccountUpdate.children and AccountUpdate.parent properties https://github.com/o1-labs/o1js/pull/1402
    • Also removes the optional AccountUpdatesLayout argument to approve()
    • Adds AccountUpdateTree and AccountUpdateForest, new classes that represent a layout of account updates explicitly
    • Both of the new types are now accepted as inputs to approve()
    • accountUpdate.extractTree() to obtain the tree associated with an account update in the current transaction context.
  • Remove Experimental.Callback API https://github.com/o1-labs/o1js/pull/1430

Added

Fixed

0.16.0

Breaking changes

Added

Changed

0.15.4

Changed

Added

  • Configurable networkId when declaring a Mina instance. https://github.com/o1-labs/o1js/pull/1387
    • Defaults to "testnet", the other option is "mainnet"
    • The networkId parameter influences the algorithm used for signatures, and ensures that testnet transactions can't be replayed on mainnet

0.15.3

Added

Changed

  • Mina.accountCreationFee() is deprecated in favor of Mina.getNetworkConstants().accountCreationFee. https://github.com/o1-labs/o1js/pull/1367
    • Mina.getNetworkConstants() returns:
      • default network constants if used outside of the transaction scope.
      • actual network constants if used within the transaction scope.

Fixed

0.15.2

Fixed

0.15.1

Breaking changes

Added

Fixed

0.15.0

Breaking changes

Added

Changed

Fixed

0.14.2

Breaking changes

Added

Changed

Fixed

  • Add a parameter to checkZkappTransaction for block length to check for transaction inclusion. This fixes a case where Transaction.wait() only checked the latest block, which led to an error once the transaction was included in a block that was not the latest. https://github.com/o1-labs/o1js/pull/1239

0.14.1

Added

Fixed

0.14.0

Breaking changes

Changed

  • ZkProgram has moved out of the Experimental namespace and is now available as a top-level import directly. Experimental.ZkProgram has been deprecated.
  • ZkProgram gets a new input argument name: string which is required in the non-experimental API. The name is used to identify a ZkProgram when caching prover keys. https://github.com/o1-labs/o1js/pull/1200

Added

Changed

  • Use cached prover keys in compile() when running in Node.js https://github.com/o1-labs/o1js/pull/1187
    • Caching is configurable by passing a custom Cache (new export) to compile()
    • By default, prover keys are stored in an OS-dependent cache directory; ~/.cache/pickles on Mac and Linux
  • Use cached setup points (SRS and Lagrange bases) when running in Node.js https://github.com/o1-labs/o1js/pull/1197
    • Also, speed up SRS generation by using multiple threads
    • Together with caching of prover keys, this speeds up compilation time by roughly
      • 86% when everything is cached
      • 34% when nothing is cached

0.13.1

Breaking changes

  • Changes to some verification keys caused by changing the way Struct orders object properties. https://github.com/o1-labs/o1js/pull/1124 @Comdex
    • To recover existing verification keys and behavior, change the order of properties in your Struct definitions to be alphabetical
    • The customObjectKeys option is removed from Struct

Changed

  • Improve prover performance by ~25% https://github.com/o1-labs/o1js/pull/1092
    • Change internal representation of field elements to be JS bigint instead of Uint8Array
  • Consolidate internal framework for testing equivalence of two implementations

0.13.0

Breaking changes

0.12.2

Changed

0.12.1

Added

  • Added a method createTestNullifier to the Nullifier class for testing purposes. It is recommended to use mina-signer to create Nullifiers in production, since it does not leak the private key of the user. The Nullifier.createTestNullifier method requires the private key as an input outside of the users wallet. https://github.com/o1-labs/o1js/pull/1026
  • Added field.isEven to check if a Field element is odd or even. https://github.com/o1-labs/o1js/pull/1026

Fixed

0.12.0

Breaking Changes

  • Fix the default verification key hash that was generated for AccountUpdates. This change adopts the default mechanism provided by Mina Protocol https://github.com/o1-labs/o1js/pull/1021
    • Please be aware that this alteration results in a breaking change affecting the verification key of already deployed contracts.

0.11.4

Fixed

0.11.3

Fixed

0.11.2

Fixed

0.11.1

Breaking changes

Added

  • Implemented Nullifier as a new primitive https://github.com/o1-labs/o1js/pull/882
    • mina-signer can now be used to generate a Nullifier, which can be consumed by zkApps using the newly added Nullifier Struct

Changed

Fixed

0.11.0

Breaking changes

Added

Changed

Deprecated

Fixed

0.10.1

Changed

0.10.0

Breaking Changes

  • All references to actionsHash are renamed to actionState to better mirror what is used in Mina protocol APIs https://github.com/o1-labs/o1js/pull/833
    • This change affects function parameters and returned object keys throughout the API
  • No longer make MayUseToken.InheritFromParent the default mayUseToken value on the caller if one zkApp method calls another one; this removes the need to manually override mayUseToken in several known cases https://github.com/o1-labs/o1js/pull/863
    • Causes a breaking change to the verification key of deployed contracts that use zkApp composability

Added

Changed

Deprecated

Fixed

  • SmartContract.deploy() now throws an error when no verification key is found https://github.com/o1-labs/o1js/pull/885
    • The old, confusing behaviour was to silently not update the verification key (but still update some permissions to "proof", breaking the zkApp)

0.9.8

Fixed

0.9.7

Added

Changed

  • Circuit.runAndCheck() now uses snarky to create a constraint system and witnesses, and check constraints. It closely matches behavior during proving and can be used to test provable code without having to create an expensive proof https://github.com/o1-labs/o1js/pull/840

Fixed

0.9.6

Breaking changes

  • Circuits changed due to an internal rename of "sequence events" to "actions" which included a change to some hash prefixes; this breaks all deployed contracts.
  • Temporarily reintroduces 2 known issues as a result of reverting a fix necessary for network redeployment:
  • Improve number of constraints needed for Merkle tree hashing https://github.com/o1-labs/o1js/pull/820
    • This breaks deployed zkApps which use MerkleWitness.calculateRoot(), because the circuit is changed
    • You can make your existing contracts compatible again by switching to MerkleWitness.calculateRootSlow(), which has the old circuit
  • Renamed function parameters: The getAction function now accepts a new object structure for its parameters. https://github.com/o1-labs/o1js/pull/828
    • The previous object keys, fromActionHash and endActionHash, have been replaced by fromActionState and endActionState.

Added

Fixed

  • Improved Event Handling in o1js https://github.com/o1-labs/o1js/pull/825
    • Updated the internal event type to better handle events emitted in different zkApp transactions and when multiple zkApp transactions are present within a block.
    • The internal event type now includes event data and transaction information as separate objects, allowing for more accurate information about each event and its associated transaction.
  • Removed multiple best tip blocks when fetching action data https://github.com/o1-labs/o1js/pull/817
    • Implemented a temporary fix that filters out multiple best tip blocks, if they exist, while fetching actions. This fix will be removed once the related issue in the Archive-Node-API repository (https://github.com/o1-labs/Archive-Node-API/issues/7) is resolved.
  • New fromActionState and endActionState parameters for fetchActions function in o1js https://github.com/o1-labs/o1js/pull/828
    • Allows fetching only necessary actions to compute the latest actions state
    • Eliminates the need to retrieve the entire actions history of a zkApp
    • Utilizes actionStateTwo field returned by Archive Node API as a safe starting point for deriving the most recent action hash

0.9.5

Breaking changes

Fixed

  • Failing Mina.transaction on Berkeley because of unsatisfied constraints caused by dummy data before we fetched account state https://github.com/o1-labs/o1js/pull/807
    • Previously, you could work around this by calling fetchAccount() for every account invovled in a transaction. This is not necessary anymore.
  • Update the zkApp verification key from within one of its own methods, via proof https://github.com/o1-labs/o1js/pull/812

0.9.4

Fixed

0.9.3

Added

  • Use fetchEvents() to fetch events for a specified zkApp from a GraphQL endpoint that implements this schema. Mina.Network accepts an additional endpoint which points to a GraphQL server. https://github.com/o1-labs/o1js/pull/749
    • Use the mina property for the Mina node.
    • Use archive for the archive node.
  • Use getActions to fetch actions for a specified zkApp from a GraphQL endpoint GraphQL endpoint that implements the same schema as fetchEvents. https://github.com/o1-labs/o1js/pull/788

Fixed

0.9.2

Added

Changed

  • On-chain value globalSlot is replaced by the clearer currentSlot https://github.com/o1-labs/o1js/pull/755
    • currentSlot refers to the slot at which the transaction will be included in a block.
    • the only supported method is currentSlot.assertBetween() because currentSlot.get() is impossible to implement since the value is determined in the future and currentSlot.assertEquals() is error-prone

Fixed

0.9.1

Fixed

0.9.0

Added

Changed

Removed

0.8.0

Added

  • this.account.<field>.set() as a unified API to update fields on the account https://github.com/o1-labs/o1js/pull/643
    • covers permissions, verificationKey, zkappUri, tokenSymbol, delegate, votingFor
    • exists on SmartContract.account and AccountUpdate.account
  • this.sender to get the public key of the transaction's sender https://github.com/o1-labs/o1js/pull/652
    • To get the sender outside a smart contract, there's now Mina.sender()
  • tx.wait() is now implemented. It waits for the transactions inclusion in a block https://github.com/o1-labs/o1js/pull/645
    • wait() also now takes an optional options parameter to specify the polling interval or maximum attempts. wait(options?: { maxAttempts?: number; interval?: number }): Promise<void>;
  • Circuit.constraintSystemFromKeypair(keypair) to inspect the circuit at a low level https://github.com/o1-labs/o1js/pull/529
    • Works with a keypair (prover + verifier key) generated with the Circuit API
  • Mina.faucet() can now be used to programmatically fund an address on the testnet, using the faucet provided by faucet.minaprotocol.com https://github.com/o1-labs/o1js/pull/693

Changed

  • BREAKING CHANGE: Constraint changes in sign(), requireSignature() and createSigned() on AccountUpdate / SmartContract. This means that smart contracts using these methods in their proofs won't be able to create valid proofs against old deployed verification keys. https://github.com/o1-labs/o1js/pull/637
  • Mina.transaction now takes a public key as the fee payer argument (passing in a private key is deprecated) https://github.com/o1-labs/o1js/pull/652
    • Before: Mina.transaction(privateKey, ...). Now: Mina.transaction(publicKey, ...)
    • AccountUpdate.fundNewAccount() now enables funding multiple accounts at once, and deprecates the initialBalance argument
  • New option enforceTransactionLimits for LocalBlockchain (default value: true), to disable the enforcement of protocol transaction limits (maximum events, maximum sequence events and enforcing certain layout of AccountUpdates depending on their authorization) https://github.com/o1-labs/o1js/pull/620
  • Change the default send permissions (for sending MINA or tokens) that get set when deploying a zkApp, from signature() to proof() https://github.com/o1-labs/o1js/pull/648
  • Functions for making assertions and comparisons have been renamed to their long form, instead of the initial abbreviation. Old function names have been deprecated https://github.com/o1-labs/o1js/pull/681
    • .lt -> .lessThan
    • .lte -> .lessThanOrEqual
    • .gt -> .greaterThan
    • .gte -> greaterThanOrEqual
    • .assertLt -> .assertLessThan
    • .assertLte -> .assertLessThanOrEqual
    • .assertGt -> .assertGreaterThan
    • .assertGte -> assertGreaterThanOrEqual
    • .assertBoolean -> .assertBool

Deprecated

  • this.setPermissions() in favor of this.account.permissions.set() https://github.com/o1-labs/o1js/pull/643
    • this.tokenSymbol.set() in favor of this.account.tokenSymbol.set()
    • this.setValue() in favor of this.account.<field>.set()
  • Mina.transaction(privateKey: PrivateKey, ...) in favor of new signature Mina.transaction(publicKey: PublicKey, ...)
  • AccountUpdate.createSigned(privateKey: PrivateKey) in favor of new signature AccountUpdate.createSigned(publicKey: PublicKey) https://github.com/o1-labs/o1js/pull/637
  • .lt, .lte, gt, gte, .assertLt, .assertLte, .assertGt, .assertGte have been deprecated. https://github.com/o1-labs/o1js/pull/681

Fixed

0.7.3

Fixed

Deprecated

0.7.2

Added

Fixed

0.7.1

Fixed

0.7.0

Added

  • Added an optional string parameter to certain assert methods https://github.com/o1-labs/o1js/pull/470
  • Struct, a new primitive for declaring composite, SNARK-compatible types https://github.com/o1-labs/o1js/pull/416
    • With this, we also added a way to include auxiliary, non-field element data in composite types
    • Added VerificationKey, which is a Struct with auxiliary data, to pass verification keys to a @method
    • BREAKING CHANGE: Change names related to circuit types: AsFieldsAndAux<T> -> Provable<T>, AsFieldElement<T> -> ProvablePure<T>, circuitValue -> provable
    • BREAKING CHANGE: Change all ofFields and ofBits methods on circuit types to fromFields and fromBits
  • New option proofsEnabled for LocalBlockchain (default value: true), to quickly test transaction logic with proofs disabled https://github.com/o1-labs/o1js/pull/462
  • SmartContract.approve() to approve a tree of child account updates https://github.com/o1-labs/o1js/pull/428 https://github.com/o1-labs/o1js/pull/534
    • AccountUpdates are now valid @method arguments, and approve() is intended to be used on them when passed to a method
    • Also replaces Experimental.accountUpdateFromCallback()
  • Circuit.log() to easily log Fields and other provable types inside a method, with the same API as console.log() https://github.com/o1-labs/o1js/pull/484
  • SmartContract.init() is a new method on the base SmartContract that will be called only during the first deploy (not if you re-deploy later to upgrade the contract) https://github.com/o1-labs/o1js/pull/543
    • Overriding init() is the new recommended way to add custom state initialization logic.
  • transaction.toPretty() and accountUpdate.toPretty() for debugging transactions by printing only the pieces that differ from default account updates https://github.com/o1-labs/o1js/pull/428
  • AccountUpdate.attachToTransaction() for explicitly adding an account update to the current transaction. This replaces some previous behaviour where an account update got attached implicitly https://github.com/o1-labs/o1js/pull/484
  • SmartContract.requireSignature() and AccountUpdate.requireSignature() as a simpler, better-named replacement for .sign() https://github.com/o1-labs/o1js/pull/558

Changed

  • BREAKING CHANGE: tx.send() is now asynchronous: old: send(): TransactionId new: send(): Promise<TransactionId> and tx.send() now directly waits for the network response, as opposed to tx.send().wait() https://github.com/o1-labs/o1js/pull/423
  • Sending transactions to LocalBlockchain now involves
  • Circuit.witness can now be called outside circuits, where it will just directly return the callback result https://github.com/o1-labs/o1js/pull/484
  • The FeePayerSpec, which is used to specify properties of the transaction via Mina.transaction(), now has another optional parameter to specify the nonce manually. Mina.transaction({ feePayerKey: feePayer, nonce: 1 }, () => {}) https://github.com/o1-labs/o1js/pull/497
  • BREAKING CHANGE: Static methods of type .fromString(), .fromNumber() and .fromBigInt() on Field, UInt64, UInt32 and Int64 are no longer supported https://github.com/o1-labs/o1js/pull/519
    • use Field(number | string | bigint) and UInt64.from(number | string | bigint)
  • Move several features out of 'experimental' https://github.com/o1-labs/o1js/pull/555
    • Reducer replaces Experimental.Reducer
    • MerkleTree and MerkleWitness replace Experimental.{MerkleTree,MerkleWitness}
    • In a SmartContract, this.token replaces this.experimental.token

Deprecated

Fixed

Fixed

0.6.1

Fixed

0.6.0

Added

Changed

  • BREAKING CHANGE: Rename the Party class to AccountUpdate. Also, rename other occurrences of "party" to "account update". https://github.com/o1-labs/o1js/pull/393
  • BREAKING CHANGE: Don't require the account address as input to SmartContract.compile(), SmartContract.digest() and SmartContract.analyzeMethods() https://github.com/o1-labs/o1js/pull/406
    • This works because the address / public key is now a variable in the method circuit; it used to be a constant
  • BREAKING CHANGE: Move ZkProgram to Experimental.ZkProgram

0.5.4

Fixed

0.5.3

Fixed

0.5.2

Fixed

0.5.1

Fixed

0.5.0

Added

Changed

Fixed

0.4.3

Added

  • Implement the precondition RFC:
    • new fields this.account and this.network on both SmartContract and Party
    • this.<account|network>.<property>.get() to use on-chain values in a circuit, e.g. account balance or block height
    • this.<account|network>.<property>.{assertEqual, assertBetween, assertNothing}() to constrain what values to allow for these
  • CircuitString, a snark-compatible string type with methods like .append() https://github.com/o1-labs/o1js/pull/155
  • bool.assertTrue(), bool.assertFalse() as convenient aliases for existing functionality
  • Ledger.verifyPartyProof which can check if a proof on a transaction is valid https://github.com/o1-labs/o1js/pull/208
  • Memo field in APIs like Mina.transaction to attach arbitrary messages https://github.com/o1-labs/o1js/pull/244
  • This changelog

Changed

Removed

  • Unused functions call and callUnproved, which were embryonic versions of what is now the transaction API to call smart contract methods
  • Some unimplemented fields on SmartContract

Fixed