New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

o1js

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

o1js - npm Package Versions

134

1.4.0

Diff

Changelog

Source

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

  • 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/1694
o1-labs
published 1.3.1 •

Changelog

Source

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

  • Experimental.IndexedMerkleMap, a better primitive for Merkleized storage https://github.com/o1-labs/o1js/pull/1666 https://github.com/o1-labs/o1js/pull/1671
    • Uses 4-8x fewer constraints than MerkleMap
    • In contrast to MerkleTree and MerkleMap, IndexedMerkleMap has a high-level API that can be used in provable code
  • Added Ecdsa.verifyV2() and Ecdsa.verifySignedHashV2 methods to the Ecdsa class. https://github.com/o1-labs/o1js/pull/1669

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

  • Fix handling of fetch response for non-existing accounts https://github.com/o1-labs/o1js/pull/1679
o1-labs
published 1.3.0 •

Changelog

Source

1.3.0 - 2024-05-23

Added

  • Added base64Encode() and base64Decode(byteLength) methods to the Bytes class. https://github.com/o1-labs/o1js/pull/1659

Fixes

  • Fix type inference for method.returns(Type), to require a matching return signature https://github.com/o1-labs/o1js/pull/1653
  • Fix Struct.empty() returning a garbage object when one of the base types doesn't support empty() https://github.com/o1-labs/o1js/pull/1657
  • Fix Option.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/15588
o1-labs
published 1.2.0 •

Changelog

Source

1.2.0 - 2024-05-14

Added

  • Offchain state MVP exported under Experimental.OffchainState https://github.com/o1-labs/o1js/pull/1630 https://github.com/o1-labs/o1js/pull/1652
    • allows you to store any number of fields and key-value maps on your zkApp
    • implemented using actions which define an offchain Merkle tree
  • Option for defining an optional version of any provable type https://github.com/o1-labs/o1js/pull/1630
  • MerkleTree.clone() and MerkleTree.getLeaf(), new convenience methods for merkle trees https://github.com/o1-labs/o1js/pull/1630
  • MerkleList.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/1630
  • Permissions.VerificationKey, a namespace for verification key permissions https://github.com/o1-labs/o1js/pull/1639
    • Includes more accurate names for the impossible and proof permissions for verification keys, which are now called impossibleDuringCurrentVersion and proofDuringCurrentVersion respectively.

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

  • Fix absolute imports which prevented compilation in some TS projects that used o1js https://github.com/o1-labs/o1js/pull/1628
o1-labs
published 1.1.0 •

Changelog

Source

1.1.0 - 2024-04-30

Added

  • Exposed sideloaded verification keys https://github.com/o1-labs/o1js/pull/1606 @rpanic
    • Added Proof type DynamicProof that allows verification through specifying a verification key in-circuit
  • Provable.witnessFields() to easily witness a tuple of field elements https://github.com/o1-labs/o1js/pull/1229
  • Example for implementing RSA verification in o1js https://github.com/o1-labs/o1js/pull/1229 @Shigoto-dev19
    • Check out https://github.com/o1-labs/o1js/blob/main/src/examples/crypto/rsa/rsa.ts and tests in the same folder

Changed

  • Gadgets.rangeCheck64() now returns individual range-checked limbs for advanced use cases https://github.com/o1-labs/o1js/pull/1229

Fixed

  • Fixed issue in UInt64.rightShift() where it incorrectly performed a left shift instead of a right shift. https://github.com/o1-labs/o1js/pull/1617
  • Fixed issue in ForeignField.toBits() where high limbs were under-constrained for input length less than 176. https://github.com/o1-labs/o1js/pull/1617
  • Make dummyBase64Proof() lazy. Significant speed up when generating many account updates with authorization Proof while proofs turned off. https://github.com/o1-labs/o1js/pull/1624
o1-labs
published 1.0.1 •

Changelog

Source

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

  • Export Events under AccountUpdate.Events. https://github.com/o1-labs/o1js/pull/1563
  • Mina.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/1567
  • TransactionPendingPromise enables calling wait directly on the promise returned by calling send on a Transaction. https://github.com/o1-labs/o1js/pull/1567
  • initializeBindings() to explicitly trigger setup work that is needed when running provable code https://github.com/o1-labs/o1js/pull/1583
    • calling this function is optional

Changed

  • Remove top-level await https://github.com/o1-labs/o1js/pull/1583
    • To simplify integration with bundlers like webpack
  • Make MerkleTree.{nodes,zeroes} public properties https://github.com/o1-labs/o1js/pull/1555
    • This makes it possible to clone merkle trees, which is often needed

Fixed

  • Fix error when computing Merkle map witnesses, introduced in the last version due to the toBits() change https://github.com/o1-labs/o1js/pull/1559
  • Improved error message when compiling a program that has no methods. https://github.com/o1-labs/o1js/pull/1563
o1-labs
published 0.18.0 •

Changelog

Source

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

  • Provable.witnessAsync() to introduce provable values from an async callback https://github.com/o1-labs/o1js/pull/1468
  • Internal benchmarking tooling to keep track of performance https://github.com/o1-labs/o1js/pull/1481
  • Add toInput method for Group instance https://github.com/o1-labs/o1js/pull/1483

Changed

  • field.assertBool() now also returns the Field as a Bool for ergonomics https://github.com/o1-labs/o1js/pull/1523
o1-labs
published 0.17.0 •

Changelog

Source

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

  • Support for custom network identifiers other than mainnet or testnet https://github.com/o1-labs/o1js/pull/1444
  • PrivateKey.randomKeypair() to generate private and public key in one command https://github.com/o1-labs/o1js/pull/1446
  • setNumberOfWorkers() to allow developer to override the number of workers used during compilation and proof generation/verification https://github.com/o1-labs/o1js/pull/1456

Changed

  • Improve all-around performance by reverting the Apple silicon workaround (https://github.com/o1-labs/o1js/pull/683) as the root problem is now fixed upstream https://github.com/o1-labs/o1js/pull/1456
  • Improved error message when trying to use fetchActions/fetchEvents with a missing Archive Node endpoint https://github.com/o1-labs/o1js/pull/1459

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

  • Mitigate security hazard of deploying token contracts https://github.com/o1-labs/o1js/issues/1439
  • Make Circuit handle types with a .provable property (like those used in ECDSA) https://github.com/o1-labs/o1js/pull/1471
    • To support offchain, non-Pickles proofs of ECDSA signatures
o1-labs
published 0.16.2 •

o1-labs
published 0.16.1 •

Changelog

Source

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

  • MerkleList<T> to enable provable operations on a dynamically-sized list https://github.com/o1-labs/o1js/pull/1398
    • including MerkleListIterator<T> to iterate over a merkle list
  • TokenContract, a new base smart contract class for token contracts https://github.com/o1-labs/o1js/pull/1384
    • Usage example: 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
    • this is used to implement TokenContract under the hood

Fixed

  • Mainnet support. https://github.com/o1-labs/o1js/pull/1437
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc