Skip to content

Releases: bitcoin-computer/monorepo

0.26.0-beta.0

23 Jul 22:09
84b479d

Choose a tag to compare

0.26.0-beta.0 Pre-release
Pre-release

We're excited to announce version 0.26.0-beta.0, packed with enhancements to make your blockchain applications faster, more versatile, and cost-efficient. Here's what's new:

  • Expanded Blockchain Support: Now includes Dogecoin and Pepecoin with bigint for precise handling of large satoshi amounts.
  • Disk-Based Caching: Boosts app performance by persisting on-chain objects to disk, ensuring speed even after page reloads.
  • Updated P2P Chess Game: Now features a serverless design for direct player interaction (trust-based for now).
  • Lower Transaction Fees: Optimized dust calculations reduce costs for on-chain operations.
  • Protocol Fees Introduced: Small fees (e.g., ~$0.007 on Litecoin under the current asset value) to support ongoing development.
  • Clarified Patent Grant: Automatic license for our patented tech when using the library, with options for custom licensing.

Dive into the details below for a full breakdown of features, improvements, and breaking changes.

Lib

Support for Dogecoin and Pepecoin

This release adds support for Dogecoin and Pepecoin. Both coins have tail emission and an unbounded supply, so satoshi amounts can exceed JavaScript’s safe integer range. We’ve upgraded all satoshi values from number to bigint to guarantee exact on‑chain representation. We’ve renamed the _amount field to _satoshis, so it’s clear you’re dealing with satoshis, not whole coins. To enable bigint support, our packages now target ES2020. #368

// Initialize smart contract wallet for Dogecoin
const computer = new Computer({ chain: 'DOGE', ... })

Disk Based Caching

All on-chain objects are now persisted to disk after they’re computed — so your app stays fast, even after a full page reload. #393

In version 0.24 we introduced in‑memory caching, delivering huge speedups for single‑page applications. But because memory isn’t persistent, any on‑chain object had to be recomputed after every reload. Now, with disk‑backed caching, all objects read from the blockchain are automatically written to disk, batched when the read is completed. On reload, your app loads the latest state from disk — no more wasted cycles recomputing state. Upgrading to version 0.26 will bring to your Bitcoin Computer apps an instant performance boost with zero changes to your code.

Unlike other JavaScript caches, we’re not just serializing JSON — we’re persisting full JavaScript objects including their functions. To deliver guaranteed constant‑time lookups, we forbid mutation of functional properties. This constraint maintains JavaScript's expressive power, while ensuring every cached object is retrieved very quickly.

Under the hood, each transaction is now downloaded only once and every JavaScript expression is computed only once, even after page reloads. We’ve also added aggressive HTTP caching, so every cacheable request hits the server at most once. Currently, disk‑backed caching is enabled by default — no configuration required. In future releases, we’ll introduce fine‑tuning options once we’ve gathered more experience using the cache.

Decrease Transaction Fees

We’ve refined our dust-calculation to drive down transaction fees. Metadata such as the JavaScript expressions are stored in outputs with dust amount, so reducing the dust amount makes every on chain operation cheaper. #405

Introducing Protocol Fees

Starting with this release, every transaction built with our library will automatically include a small protocol fee paid to BCDB Inc., the team behind Bitcoin Computer. For most transactions, this fee will be around $0.007 on Litecoin under the current asset value. #405

How It Works

  • Embedding Your Code: Each Bitcoin Computer transaction encodes your JavaScript expression and other metadata like the environment into one or more bare multisig scripts, each carrying the smallest allowable (non-dust) output.
  • Preventing UTXO Bloat: To ensure these outputs don’t bloat the UTXO set, we include a public key that only BCDB Inc. can spend.
  • Sweeping Fees: When on-chain fees fall low enough, BCDB Inc. will collect these dust-level outputs — amounting to about $0.005 per output on Litecoin — to fund continued development.

This approach keeps your UTXO set clean while sustainably supporting the Bitcoin Computer platform. See here for details about how the fees are calculated.

Clarify Patent Grant

When you use our library, you’re automatically granted a license to use our patented technology — no extra steps required. Want to leverage the patented tech without the library? We’ve got you covered — just reach out to us for tailored licensing options. See here for more information.

More Tests

We’ve expanded our integration tests for the lib package to ensure greater reliability. To run the tests, navigate to the lib directory and execute npm test. #366

NakamotoJs

  • BigInt support: NakamotoJs now natively supports bigint values. #368
  • Integrated testing: Run end‑to‑end tests directly within the NakamotoJs package. #363
  • Simplified fixtures: All test fixtures have been converted from JSON to JavaScript to eliminate dynamic imports.

Node

  • Expanded mainnet support: The node now supports Dogecoin and Pepecoin. #368
  • Robust edge‑case handling: Correctly processes scenarios for BTC, like multiple coinbase transactions sharing the same hash, in line with BIP34.

Apps

Updated Peer-to-Peer Chess Game

We’ve updated our peer-to-peer chess game in which two players can stake an amount — and the winner takes the pot. Until now, an operator was required to run a server. This version removes the need for an operator and any servers besides Bitcoin Computer nodes. However in this version, the two players need to trust one another. In a future update, we will deliver a fully trustless experience. #401

The chess-server package was removed #385

Components

  • Added address search in the NavBar #361, #362
  • Published components package to NPM for seamless integration #357
  • Optimized the wallet component to fetch the latest balance only when it’s visible, boosting performance across all apps #393
  • Login form: validations are now enabled, the PATH variable was included again in the .env.examples files, if the .env does not contain CHAIN, NETWORK, URL or PATH, they are displayed in the form #399
  • The deploy.ts scripts includes an automatic update of the .env files with the deployed contracts #399
  • Defaults coin type to 1 for bip44 path #399

Vite Template

  • Enhanced cross-origin isolation by setting the necessary Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers. #359
  • Introduced Puppeteer end-to-end tests to validate UI workflows. #362
  • Added automated checks to ensure mandatory cross-origin isolation headers are present. #361
  • Simplified imports by removing the bitcoin-computer/lib alias in the Vite template (now retained only for Vitest). #362
  • Upgraded the Vite template to a standalone package for easier installation and maintenance. #361, #372

Next.js Template

  • Introduced a Next.js template, enabling server‑side rendering with client side custody. #401

Documentation & Testing Enhancements

  • Expanded documentation: Significant updates and refinements to guides, examples, and API references #360, #364, #365, #366, #367
  • In-test debugging: Debug test suites with new support for breakpoints and interactive inspection #373

Breaking Changes

_amount_satoshis

We've renamed the _amount field to _satoshis and upgraded its type from number to bigint.
Migration steps:

  1. Replace every _amount reference with _satoshis. #368
  2. Wrap numeric values with BigInt(n) when assigning or computing.
  3. Include a postfix n for big integer constant values.
    For more on using big integers, see the [MDN BigInt guide]...
Read more

0.24.1-beta.0

19 Feb 21:08
b22fbdb

Choose a tag to compare

0.24.1-beta.0 Pre-release
Pre-release

This PR introduces three important performance improvements: server-side events, client-side caching, and network request batching.

Lib

Server-Sent Events #327

This update introduces computer.subscribe, a new function that enables real-time updates via Server-Sent Events (SSEs). The function takes an on-chain ID and a callback function as arguments. The callback is triggered whenever the on-chain object with the specified ID is updated. It returns a function to close the connection to the server when it is no longer needed.

class A extends Contract {
  constructor(n) {
    super({ n });
  }

  inc(n) {
    this.n += n;
    return this.n;
  }
}

let eventCount = 0;
const computer = new TestComputer();
await computer.faucet(1e8);
const counter = await computer.new(A, [1]);

close = await computer.subscribe(a._id, ({ rev, hex }) => {
  console.log(`Counter updated to revision ${rev} by a tx ${hex}`);
  eventCount += 1;
});

await a.inc(1);
await a.inc(1);

expect(eventCount).eq(2);

await close();

Client-Side Caching #330

With this release, on-chain objects are cached in memory whenever they are computed. This means they can be retrieved from memory instead of being recomputed when loaded for the second time and beyond.

The cache automatically manages memory consumption and removes elements when necessary. To measure memory usage for the entire app (not just the cache), we use process.memoryUsage in Node.js and performance.measureUserAgentSpecificMemory in the browser. For browsers that do not support this API (less than 25% of the user base), we currently disable the cache. In a future release, we will allow application developers to configure and manage the cache manually, ensuring support for all browsers.

Network Request Batching #330

Before this release, each transaction in the history of an on-chain object was downloaded in a separate network request. With this release, we download the IDs of all relevant transactions in a single request. Then, we remove the IDs of transactions whose objects are already in the cache. A second network request downloads the minimal set of transactions required to compute the latest state of the on-chain object. The client then extracts the JavaScript expressions from the transactions, computes the value of the object, and stores it in the cache.

Dogecoin Integration over Regtest #322

To configure the client-side library to use Dogecoin, set chain to 'DOGE' in the Computer constructor.

import { Computer } from '@bitcoin-computer/lib'

const computer = new Computer({
  chain: 'DOGE',
  network: 'regtest',
  url: 'http://localhost:1031',
  satPerByte: 3000
})

We recommend setting satPerByte to at least 3000 for Dogecoin and Pepecoin; otherwise, transactions may be rejected by the node.

The optional parameter moduleStorageType now defaults to multisig for DOGE and PEPE, and to taproot for BTC and LTC. This parameter determines the type of Bitcoin Script used to store ES6 modules on the blockchain. For more information about the module system see here.

Node

Bitcoin Computer Node is Now Available on Docker Hub (#353)

The Bitcoin Computer Node is now available as a multi-platform Docker image (amd64/arm64) on Docker Hub. This simplifies deployment for final users to just pull the image and run it - no rebuilding required.

Endpoint for Transaction ID History (#342)

A new endpoint has been added to the node to retrieve the IDs of all transactions that a specified on-chain object state depends on. This endpoint is used internally to enable network request batching.

class Counter extends Contract {
  constructor() {
    super({ counter: 0 })
  }

  inc() {
    this.counter += 1
  }

  sum(c1: Counter) {
    this.counter += c1.counter
  }
}

const computer = new Computer()
await computer.faucet(0.1e7)

const c1 = await computer.new(Counter) // broadcasts tx_1
const c2 = await computer.new(Counter) // broadcasts tx_2
await c1.inc() // broadcasts tx_3
await c1.sum(c2) // broadcasts tx_4

const txId4 = c1._rev.split(':')[0]
const txIds = await computer.wallet.restClient.getAncestors(txId4)

// txIds === [tx_1, tx_2, tx_3, tx_4]

Logging System Improvements #328

You can now configure the BCN_ENV variable from the .env file. The console logs are only shown in 'dev' mode.

BCN_ENV='dev' # 'dev' or 'prod'

Log files are created based on the desired log level, which can be configured through the BCN_LOG_LEVEL variable in the .env file.

# Winston Logger Levels

# 0: Error logs only
# 1: Error and warning logs
# 2: Error, warning and info logs
# 3: Error, warning, info and http logs
# 4: Error, warning, info, http and debug logs

BCN_LOG_LEVEL='2'

Dogecoin Support on Regtest (#322)

The node now supports Dogecoin on regtest network mode. Example configuration files have been added to the chain-setup folder.

Docs

NakamotoJs

More work towards full Dogecoin integration in NakamotoJs #322

Apps

Chess

  • The wagers are now paid to the winner. #304
  • Improved UI and UX. #304 #333
  • The handshake between opponents has been simplified. #304
  • Fixed a bug where a chess piece would "snap back" after it was moved. #333

Explorer

  • Fixes dark mode bug for the prev/next buttons in the Smart Objects page. #338

Vite-Template

  • Added a basic test with puppeteer. #340

All Packages

Full Commit Log

v0.23.0-beta.0...v0.24.1-beta.0

0.23.0-beta.0

12 Dec 21:11
1615769

Choose a tag to compare

0.23.0-beta.0 Pre-release
Pre-release

This release focuses on performance optimizations, enhanced usability, and new features for Bitcoin smart contract developers.

Node

  • Performance Improvements #297

    • Version 0.21 introduced automatic block reorg recovery at the cost of performance degradation; this update restores the original performance while retaining recovery functionality This was achieved by:
      • Batching database queries.
      • Optimizing process management using spawn, instead of using cluster library.
      • Reduced DB thread dependencies to improve parallelism.
      • Improving synchronization process and database interactions.
      • Consolidating Input and Output operations into a single SQL query.
      • Activating the ZMQ only after a user configurable threshold.
      • Block reorg detection now activates after a user-defined threshold, optimizing resource usage.
  • Db Schema Changes #297

    • Add field for output scripts ASMs to support a wider range of queries for outputs with specific scripts.
    • Remove field that stores public key arrays as all queries that it supported can be evaluated using the ASM field.

Lib

  • Expressive Power #295
    • Support for arbitrary Bitcoin scripts has been added. Data ownership can now be defined using any Bitcoin script by passing its ASM to the _owners property of a smart object. Previously, only multisig scripts encoded as arrays of public keys were supported. This enhancement enables new types of smart contracts, such as using a BitVM script to enforce data ownership.
  • Usability #302
    • Error messages now provide clearer guidance when invalid keys are passed to the Computer class.
    • Added function computer.isUnspent(rev) to test if a revision is unspent.
    • Fix bug where the state of a smart objects on the blockchain was not updated when the object was updated locally. Specifically this was the case for smart objects returned from function calls and the ones returned from computer.encode. Now all smart objects reliably broadcast transactions when the corresponding object are updated.
  • New features #303
    • Given a smart object, it is now possible to compute the previous and next state. Specifically, given the revision rev of a smart object computer.prev(rev) and computer.next(rev) will return the previous and next revision (or null if no such revision exists).

Apps

  • Ported all apps from Create React App to Vite due to it's better developer experience (for example, out of the box ESM and TS support). #275
  • Fixed dark mode issues across Wallet, Explorer, NFT, and templates (CRA and Vite). #287
  • Revamped the Chat and NFT app UI. #277
  • Simplified and upgraded dependencies. #294
  • Unified script names across packages. For example, all packages now have the NPM commands "build", "test", "start", etc. #289 #290
  • Starting work on a chess application. #292 #298

Dev Ops

  • Integrated Turbo build tool for faster and more reliable builds. #288 #306

Types

  • Improved typing precision by narrowing many types, including fixing the type of the Contract class to ensure smart objects are now correctly typed. #302

0.22.0-beta.0

09 Oct 21:27
6abd860

Choose a tag to compare

0.22.0-beta.0 Pre-release
Pre-release

Lib

  • Our module system now supports chains that do not have Taproot. You can set moduleStorageType in the Bitcoin Computer constructor to multisig for chains that do not have Taproot, it defaults to taproot otherwise. #264
  • Removed the .env file for Bitcoin Computer Lib. Instead, all configuration options can be passed into the constructor. #280, #282

Node

  • You can now use a standard bitcoin.conf file to configure the node. #280, #282
  • Use one single docker-compose.yml file, reading parameters from a .env file that is specific to the chain and network. #280, #282
  • Included files .env.examples as well as bitcoin.conf example files for each supported chain and network (LTC, BTC, and PEPE at this point). #280, #282
  • More consistent naming of environment variables: Each variable related to the Bitcoin node starts with BITCOIN, each variable related to the Bitcoin Computer Node starts with BCN. #280, #282
  • The db-data and blockchain-data folders are now stored in their corresponding chain-setup/** folder. #280, #282
  • The reset command no longer deletes blockchain data to speed up startup time. #280, #282

Fixes

  • Add support for chains where getBlock does not have a verbosity level that returns all transactions hexes (e.g. PepeCoin). For these chains every transaction in the block is read using getRawTransaction. #280
  • Fixes the error 'bind message has x parameter formats but 0 parameters' when syncing to tesntet. #281
  • When the wallet already exists, it nows shows an information message, instead of an error. #281

Cleanup

  • Remove the root level scripting ways to run up, down and reset the node (we now have to go to the folder packages/node to run them). #280
  • Cleanup dependencies. #269 #265

Apps

  • Include examples using the Vite build tool, to simplify the configuration and setup of new apps. #262 #275
  • More improvements to the apps. #257 #258 #259 #260 #274

0.21.0-beta.0

23 Aug 18:34
d0c0800

Choose a tag to compare

0.21.0-beta.0 Pre-release
Pre-release

Node

  • The Bitcoin Computer Node now automatically detects and handles block reorgs. When a reorg occurs, the database is rolled back to last valid block and resynchronized from there. This guarantees that the state of the on-chain assets as well as the balance in satoshi is computed correctly when a re-org occurs. #252.
  • The node can now compute both the confirmed as well as the unconfirmed balance in satoshi. #252
  • We re-factored and re-organized the entire codebase of the node. #252
  • We fixed a bug where the wrong result was returned from the computer.query() function when called with an empty object. #236
  • We simplified the way we manage parallelism: we used to launch multiple docker processes via a Python script. Instead we are using the built in node.js core module "cluster". This gives us more control over parallelism while simplifying our architecture. #252

Apps

  • Simplified the login window for all apps and fixes slow login rendering. #244
  • We added a faucet button to the apps to simplify the usability on regtest. #246
  • You can now search by publicKey in the NFT app. #235
  • Refactor deploy scripts to make them easier to use. #242
  • Refactored the UX of playground in the Explorer. #243
  • Fix the order of NFTs on the home screen of the NFT app. #237

Docs

  • Included extended comparison of the Bitcoin Computer to other Smart Contract systems. #231 #238 #240 #241 #251

API Changes

  • computer.getBalance() now returns both the confirmed and unconfirmed balance. #252

Infrastructure Changes

  • New sync service added to the regtest docker-compose file. #252

Pepecoin Integration

  • We are now supporting Pepecoin! Many thanks to @Unknown-Kush for the contribution. #227

0.20.0-beta.0

19 Jun 21:22
0d324cb

Choose a tag to compare

0.20.0-beta.0 Pre-release
Pre-release

Lib

  • No more Bitcoin Computer fees! We are waiving the Bitcoin Computer fees (for a limited time only).
  • Reduced miner fees. We've implemented a more concise on-chain metadata format. This leads to smaller transaction size and therefore lower miner fees to the user. #213
  • Reduced complexity. The code for lib has been massively refactored, removing over 1000 lines of code without impacting functionality. This improves maintainability and reduces the probability of undetected bugs.
  • Faster applications. The smaller code base makes the lib bundles about 10% smaller, leading to faster page load times.
  • Better compatibility. We now provide a CommonJs bundle in addition to the existing ES6 bundles. This makes it possible to import the library with both import and require. #208
  • Documentation. Add example to readme file that shows how to execute a smart contract in the browser without installing any software.
  • Bug fix. Fixed a bug when querying by id and another parameter.

Node

  • Faster synchronization. Until now, the Bitcoin Computer Node had to parse the blockchain sequentially from the Bitcoin Computer activation block. Now the sync process is perfectly parallel - this means that synchronizing can take advantage of modern hardware architectures and scales with the number of cores of the machine.
  • Faster transaction parsing. Transaction parsing is now 10-20% faster.
  • Robustness and user friendliness. Resuming an aborted blockchain synchronization is now more robust and easier to configure. This makes it possible to quickly sync a node on a powerful machine and to then downgrade to a cheap machine to lower ongoing costs. #199
  • Reduced complexity We could remove a table from the database tables and reduce the overall complexity of the code. This paves the way towards handling block reorgs in a future update. #209
  • More configuration options. We are now exposing and documenting additional configuration options via the .env file
  • Bug fix. Fixed a bug that could lead to the Bitcoin Computer Node crashing on startup or restart.

We removed the ability to query by class string. Instead we recommend to query by module specifier

Docs

  • Added a page to document the node. #207
  • Rewrote Section "Getting Started" and include example for how to run an application in the browser without installing any software #206
  • Rewrote Section "How it works" (this is worth checking out in our opinion) #206 #207
  • Started work on a comparison of the Bitcoin Computer with other smart contract systems #210. #214

Apps

  • Faster page load time. We are now using a React context to store user information so that we only connect to localstorage when the app is loaded instead of when navigating. As access to localstorage is slow this makes navigating around the apps faster. #198.
  • Cleaner Code. We resolved all type and lint issues in all apps. We are now automatically run the linter and type checker when we commit new code. #202 #205
  • Focus. We removed packages for the 404 contract #203
  • Legal. We included a legal notices on all of our readme files. #211

NakamotoJs

  • Ease of use. Adds convenience functions for computing a script and an address from a public key and an address type

Full Changelog:

What's next

  • Automatically detect and handle block reorgs. This is the last blocker to using the Bitcoin Computer in production.
  • Add support for non-standard scripts. This will enable advanced applications like pvp games and exchanges.

0.18.0-beta.0

10 Apr 22:20
b72aae4

Choose a tag to compare

0.18.0-beta.0 Pre-release
Pre-release

Lib

  • You can now test the Bitcoin Computer without having to use testnet and without having to run a node. This vastly improves the user experience for new users and streamlines the onboarding process.

Blockchain Node

  • On regtest, the halving period is configured to infinity. This has two advantages: it allows our users to test the Bitcoin Computer without having to run a node and it allows us to run an unlimited number of tests without having to restart the node. We provide multiplatform images for our custom regtest Bitcoin version 22.0 and Litecoin version 0.21.2.2.
  • We are using the official Litecoin docker image version 0.21 for LTC mainnet and testnet.

Bitcoin Computer Node

  • Adds the configuration for docker files to launch on mainnet or testnet BTC.
  • Fixes an issue with transaction parsing (while synchronizing to BTC mainnet, there was a failure when encountering multisig scripts containing lengthy invalid public keys).
  • Refactors the node synchronization process to incorporate an exponential backoff mechanism for obtaining the block hash during each sync.
  • Checks an invariant for each parallel sync process to guarantee the correct processing.

NakamotoJS

  • Adds function to serialize and deserialize a transaction (a requirement for trustless swaps).
  • Adds function to return the inputs spent by a transaction (this simplifies building swaps).

TBC404

  • Adds a smart contract and tests for NFTs with partial ownership.

Swap

  • Adds smart contracts and tests for trustless swaps.
  • Adds smart contracts and tests for trustlessly selling smart objects.
  • Each smart contract now has a helper class associated with it that simplifies its use.

TCB721-App

  • More work on integrating the smart contracts with the app.

CRA-Template

  • Installs type checker, linter, and prettier by default.

General

  • Updates all dependencies with known security vulnerabilities

0.17.2-beta.0

17 Feb 00:13
79f3eb7

Choose a tag to compare

0.17.2-beta.0 Pre-release
Pre-release
  • Changes to @bitcoin-computer/lib
    #118. Prior to these changes the Bitcoin Computer would only broadcast a transaction if the return type contained a value of object type. The reasoning was to prevent transactions from being broadcast when a getter is called.

    However after some discussion we decided that there are use cases where it is an advantage to storing (potentially large) basic types or arrays of these. So we made the change that going forward the Bitcoin Computer will broadcast a transaction on any function call (or any expression evaluated). We note that reading will still be possible for free by using property accessors (for example a.n) for which no transactions are broadcast.

  • Open source apps
    #136 #135. Drawer and wallet are now independent open source components.
    #139 #138 #137. The wallet component is integrated into the create react app open source template and the explorer app.
    #100 #103 #105 #106 #107 #113 #115 #116 #117 #118 #130. We have enhanced the explorer user experience and fixing bugs.
    #109 #112. The login component now works correct in dark mode.

  • DevOps
    #147. This release also enhances the deploy cycle with improved automation and refactor our internal scripts.

0.17.1-beta.0

31 Jan 22:07
1887e04

Choose a tag to compare

0.17.1-beta.0 Pre-release
Pre-release
  • Resolve a bug in the browser bundle, addressing issues related to the buffer package.
  • Transition from yarn to npm as the default package manager.
  • Deprecate @bitcoin-computer/nakamotojs-lib package.
  • Introduce @bitcoin-computer/nakamotojs package as its successor, now included within the monorepo.
  • Enhance the deploy cycle with improved automation.

0.17.0-beta.3

15 Jan 23:26
832df13

Choose a tag to compare

0.17.0-beta.3 Pre-release
Pre-release
  • Fix bug where instances of the Computer class connected to testnet by default.
  • More work on readme files and documentation