# Mesh 2.0: Describe the transaction. Mesh builds it.

> Mesh SDK 2.0 for Cardano makes TxBuilder the standard: typed parts, 59 typed error codes, transaction plans that resume after a crash, and a local test ledger.

Released December 2, 2026. HTML version: https://meshjs.dev/v2

Mesh is the open-source TypeScript SDK for building apps on Cardano. Version 2.0 makes `TxBuilder` the standard way to build transactions: you list what should happen, and Mesh picks the coins, sets the fee and change, adds collateral and checks your scripts before anyone signs.

```bash
npm install @meshsdk/core@2
```

- [Get started with TxBuilder](https://meshjs.dev/apis/txbuilder)
- [Upgrade guide](https://meshjs.dev/apis/txbuilder/migration)
- [Release notes](https://github.com/MeshJS/mesh/releases/tag/v2.0.0)

## Why it is a big deal, in plain English

Mesh is a toolkit that app builders use to move money and digital assets on the Cardano blockchain. Version 2.0 changes how those transfers are put together. Here is what that means, without the jargon.

- **Name the destination, not every turn.** Before, a developer gave Mesh turn-by-turn directions for every transfer. Now they say where to go ("send 5 ada to this person", "create this token") and Mesh works out the route: which coins to use, the fee and the change. Ada is Cardano's currency.
- **A clear warning before anything is sent.** Instead of a "something went wrong" light, Mesh says exactly what is wrong, such as "you need 2.3 more ada", and whether pressing the button again is safe. It says so before anything is sent.
- **A checklist that survives a power cut.** Some jobs take several transfers in a row. Mesh writes each step down as it goes, so if the server crashes the job picks up where it stopped, and trying again never pays twice.
- **A flight simulator for money.** Developers can rehearse everything on a practice blockchain on their own computer: fast-forward time, crash safely, and only then go live with real funds.

## What is new for developers

### TxBuilder: build from typed parts

Pass parts such as `output()`, `mint.native()` and `spend.plutus()` with a payer to `build()`. Mesh resolves inputs, selects coins, sets the fee and change, adds collateral and evaluates Plutus scripts locally by default (Scalus, pure JavaScript). Amounts are `bigint`, so `5` where `5n` belongs is a compile error.

In plain words: You write down what you want; Mesh fills in the forms correctly.

Docs: [TxBuilder basics](https://meshjs.dev/apis/txbuilder/basics)

### Typed errors you can act on

Every failure is a `TxError` with one of 59 codes, such as `INSUFFICIENT_FUNDS` or `EVALUATION_FAILED`. `TxError.is(err, "CODE")` narrows `details` to that code, and `retryable` says when repeating the call is safe.

In plain words: Not a warning light, but a dashboard that says "low on fuel: you need 2.3 more ada".

Docs: [Error reference](https://meshjs.dev/apis/txbuilder/errors)

### Plans that resume and never double-pay

`plan()` builds several linked transactions once and never rebuilds them, so retries always send the same bytes. With a `store`, `resume(id)` continues a plan from any process after a restart, and `replan()` handles expired or rolled-back steps.

In plain words: Like recorded delivery: if the van breaks down, the parcel is not sent twice.

Note: Plans need a provider that returns block heights. With `BlockfrostProvider`, use the `BlockfrostWithHeights` subclass from the docs for now. See [Blockfrost for plans](https://meshjs.dev/apis/txbuilder/networks#use-blockfrost-for-plans).

Docs: [Transaction plans](https://meshjs.dev/apis/txbuilder/plans)

### A local Cardano ledger for tests

The new `@meshsdk/tx-emulator` is a provider, submitter and evaluator in one, with a controllable clock, `fork()`, `simulate()` and governance state. Test full flows, time locks and plans with no testnet, no faucet and no waiting.

In plain words: Practise every manoeuvre, fast-forward time and crash safely before you fly for real.

Docs: [Testing with the emulator](https://meshjs.dev/apis/txbuilder/testing)

### Conway governance as first-class parts

`certificate.*`, `vote()` and `proposal.*` cover DRep and committee certificates, delegations, votes and every proposal type. For parameter-change and treasury-withdrawal proposals, the builder looks up the constitutional guardrail script for you.

In plain words: Voting on how Cardano is run becomes as easy to build as sending a payment.

Docs: [Governance](https://meshjs.dev/apis/txbuilder/governance)

### Offline and multi-party signing

Build without network reads, import a transaction with `fromCbor()`, list exactly whose signatures are needed with `requiredSigners()` and merge witnesses. `submit()` refuses an under-signed transaction with `MISSING_SIGNATURES`.

In plain words: A cheque that needs three signatures: Mesh says whose are missing and will not cash it until all are there.

Docs: [Offline signing](https://meshjs.dev/apis/txbuilder/offline)

## Before and after

Both versions start from the same provider and wallet. `words`, `recipient`, `script` and `assetUtxo` come from your app.

```ts
import { BlockfrostProvider, MeshWallet } from "@meshsdk/core";

const provider = new BlockfrostProvider("<YOUR_API_KEY>");
const wallet = new MeshWallet({
  networkId: 0,
  fetcher: provider,
  submitter: provider,
  key: { type: "mnemonic", words },
});
await wallet.init();
```

### Send ada

No input list, change address or call order to get right. The payer signs, and you can wait for the block.

Before (1.x, `MeshTxBuilder`):

```ts
import { MeshTxBuilder } from "@meshsdk/core";

const utxos = await wallet.getUtxos();
const changeAddress = await wallet.getChangeAddress();
const txBuilder = new MeshTxBuilder({ fetcher: provider });

const unsignedTx = await txBuilder
  .txOut(recipient, [{ unit: "lovelace", quantity: "5000000" }])
  .changeAddress(changeAddress)
  .selectUtxosFrom(utxos)
  .complete();
const signedTx = await wallet.signTx(unsignedTx);
const txHash = await wallet.submitTx(signedTx);
```

After (2.0, `TxBuilder`):

```ts
import { output, TxBuilder } from "@meshsdk/core";

const builder = new TxBuilder({ network: "preprod", provider });

const built = await builder.build(
  output({ address: recipient, value: { lovelace: 5_000_000n } }), // 5 ada
  { payer: wallet },
);
await built.sign(); // the payer signs
await built.submit(); // sent through the provider
await built.awaitInclusion(); // found in a block
console.log(built.txHash);
```

### Mint an NFT

Minting and CIP-25 metadata are two parts in a list; inputs, change and fee are worked out for you.

Before (1.x, `MeshTxBuilder`):

```ts
import { ForgeScript, MeshTxBuilder, resolveScriptHash, stringToHex } from "@meshsdk/core";

const utxos = await wallet.getUtxos();
const changeAddress = await wallet.getChangeAddress();
const txBuilder = new MeshTxBuilder({ fetcher: provider });

const forgingScript = ForgeScript.withOneSignature(changeAddress);
const policyId = resolveScriptHash(forgingScript);
const tokenNameHex = stringToHex("MeshToken");
const nft = { [policyId]: { MeshToken: { name: "Mesh Token", image: "ipfs://..." } } };

const unsignedTx = await txBuilder
  .mint("1", policyId, tokenNameHex)
  .mintingScript(forgingScript)
  .metadataValue(721, nft)
  .changeAddress(changeAddress)
  .selectUtxosFrom(utxos)
  .complete();
const signedTx = await wallet.signTx(unsignedTx);
const txHash = await wallet.submitTx(signedTx);
```

After (2.0, `TxBuilder`):

```ts
import { ForgeScript, metadata, mint, resolveScriptHash, stringToHex, TxBuilder } from "@meshsdk/core";

const builder = new TxBuilder({ network: "preprod", provider });
const changeAddress = await wallet.getChangeAddress();

const forgingScript = ForgeScript.withOneSignature(changeAddress);
const policyId = resolveScriptHash(forgingScript);
const tokenNameHex = stringToHex("MeshToken");
const nft = { [policyId]: { MeshToken: { name: "Mesh Token", image: "ipfs://..." } } };

const built = await builder.build(
  [
    mint.native({ script: forgingScript, assets: { [tokenNameHex]: 1n } }),
    metadata({ metadataLabel: 721n, value: nft }),
  ],
  { payer: wallet },
);
await built.sign();
await built.submit();
```

### Spend from a script

Collateral, execution units and the datum are handled, and the script runs locally before signing.

Before (1.x, `MeshTxBuilder`):

```ts
import { mConStr0, MeshTxBuilder } from "@meshsdk/core";

const utxos = await wallet.getUtxos();
const changeAddress = await wallet.getChangeAddress();
const collateral = (await wallet.getCollateral())[0]!;
const txBuilder = new MeshTxBuilder({ fetcher: provider, evaluator: provider });

const unsignedTx = await txBuilder
  .spendingPlutusScript(script.version)
  .txIn(assetUtxo.input.txHash, assetUtxo.input.outputIndex, assetUtxo.output.amount, assetUtxo.output.address)
  .txInInlineDatumPresent()
  .txInRedeemerValue(mConStr0([]))
  .txInScript(script.code)
  .txInCollateral(collateral.input.txHash, collateral.input.outputIndex, collateral.output.amount, collateral.output.address)
  .changeAddress(changeAddress)
  .selectUtxosFrom(utxos)
  .complete();
const signedTx = await wallet.signTx(unsignedTx);
const txHash = await wallet.submitTx(signedTx);
```

After (2.0, `TxBuilder`):

```ts
import { mConStr0, spend, TxBuilder } from "@meshsdk/core";

const builder = new TxBuilder({ network: "preprod", provider });

const built = await builder.build(
  spend.plutus({
    utxo: assetUtxo,
    script, // { code, version }
    redeemer: { data: mConStr0([]) },
    label: "unlock", // named in any error
  }),
  { payer: wallet },
);
await built.sign();
await built.submit();
```

### Handle errors

Branch on typed codes instead of message text; a mistyped code is a compile error.

Before (1.x, `MeshTxBuilder`):

```ts
try {
  const unsignedTx = await txBuilder
    .txOut(recipient, [{ unit: "lovelace", quantity: "5000000" }])
    .changeAddress(await wallet.getChangeAddress())
    .selectUtxosFrom(await wallet.getUtxos())
    .complete();
  await wallet.submitTx(await wallet.signTx(unsignedTx));
} catch (error) {
  // untyped errors, matched on message text
  if (error instanceof Error && error.message.startsWith("Evaluate redeemers failed")) {
    console.log(error.message);
  } else throw error;
}
```

After (2.0, `TxBuilder`):

```ts
import { output, TxBuilder, TxError } from "@meshsdk/core";

const builder = new TxBuilder({ network: "preprod", provider });

try {
  const built = await builder.build(
    output({ address: recipient, value: { lovelace: 5_000_000n } }),
    { payer: wallet },
  );
  await built.sign();
  await built.submit();
} catch (error) {
  if (TxError.is(error, "INSUFFICIENT_FUNDS")) {
    console.log(error.details.unit, error.details.missing); // typed by the code
  } else if (TxError.is(error, "EVALUATION_FAILED")) {
    console.log(error.label, error.details.failures); // which script part failed
  } else if (TxError.is(error) && error.retryable) {
    // SUBMIT_FAILED / CONFIRM_TIMEOUT: repeat the same call, never rebuild
  } else throw error;
}
```

## By the numbers

- **498** commits between the 1.9.0 and 2.0.0 releases
- **101 → 274** test files
- **59** typed error codes
- **35,175** npm downloads of @meshsdk/core, Nov 3 to Dec 2, 2026

Measured from the MeshJS/mesh repository at tags 1.9.0 and v2.0.0, and from the npm registry on December 3, 2026.

## Upgrading from 1.x

Your existing `MeshTxBuilder` code keeps compiling and running. In 2.0 it is deprecated and builds through the new `TxBuilder` engine, so you can move one transaction flow at a time. Review the migration notes first, because some behaviour changed.

What changed:

- `@meshsdk/core-csl` (the CSL/WASM serializer path) is removed. `CardanoSDKSerializer` from `@meshsdk/core-cst` is the only serializer.
- `MeshTxBuilder` output can differ: serialized CBOR may change, and builds that used to produce ledger-invalid transactions now throw typed errors such as `OUTPUT_BELOW_MIN_COIN`, `FEE_TOO_LOW` and `NETWORK_MISMATCH`. Match on `code`, not message text.
- Custom serializers and selectors are rejected with `INVALID_OPTION`; move custom selection to the `coinSelection` option. `txEvaluationMultiplier` now does nothing, and members such as `selectUtxos` and `evaluateRedeemers` are removed.
- `registerStakeCertificate` and `deregisterStakeCertificate` now emit Conway certificates that carry a deposit and need the stake credential's witness. `certificate.legacyStakeRegistration` and `legacyStakeDeregistration` still give the old ones.
- `@meshsdk/contract` contracts take `builder: TxBuilder` (the `mesh` option is a deprecated fallback), and `ScalusEmulator` is created with `await ScalusEmulator.create(utxos, cardanoInfo)`.

Note: Transaction plans with a plain `BlockfrostProvider` throw `CANNOT_OBSERVE` before anything is signed, because the provider version that `@meshsdk/core` 2.0.0 pins does not return block heights yet. The docs ship a short `BlockfrostWithHeights` subclass that fixes it; `build()` is unaffected. See [Use Blockfrost for plans](https://meshjs.dev/apis/txbuilder/networks#use-blockfrost-for-plans).

- [Migration guide](https://meshjs.dev/apis/txbuilder/migration)
- [Basics](https://meshjs.dev/apis/txbuilder/migration/basics)
- [Minting](https://meshjs.dev/apis/txbuilder/migration/minting)
- [Smart contracts](https://meshjs.dev/apis/txbuilder/migration/smart-contracts)
- [Staking](https://meshjs.dev/apis/txbuilder/migration/staking)
- [Governance](https://meshjs.dev/apis/txbuilder/migration/governance)
- [Errors](https://meshjs.dev/apis/txbuilder/migration/errors)
- [MeshTxBuilder reference](https://meshjs.dev/apis/txbuilder/legacy)
- [Migration skill for coding agents](https://meshjs.dev/ai/skills)

## Start building with Mesh 2.0

- [Read the docs](https://meshjs.dev/apis/txbuilder)
- [Release notes](https://github.com/MeshJS/mesh/releases/tag/v2.0.0)
- [Mesh for AI agents](https://meshjs.dev/ai/agents): Install, versions and canonical TxBuilder snippets for code generation
- [Docs MCP server](https://meshjs.dev/ai/mcp): Let your editor search and read these docs
- [Discord](https://discord.gg/dH48jH3BKa): Ask the Mesh team and community
- [X](https://x.com/meshsdk/): Follow @meshsdk for updates
