---
title: "Quickstart"
description: "Install @minter-network/tx-core, derive a BIP-44 Mx wallet, fund it from the public Testnet faucet (chainId 2, MNT), sign Send (0x01), and wait for block commit via MinterGateClient."
track: "developers"
lang: "en"
protocol: "Minter v3.3.0"
consensus: "Tendermint v0.34.19 + IAVL v0.17.3"
canonical_url: "https://docs.minter.network/developers/quickstart"
raw_markdown_url: "https://docs.minter.network/developers/quickstart.md"
---

# Quickstart

> Install @minter-network/tx-core, derive a BIP-44 Mx wallet, fund it from the public Testnet faucet (chainId 2, MNT), sign Send (0x01), and wait for block commit via MinterGateClient.

`@minter-network/tx-core` builds, RLP-encodes, signs, and broadcasts Minter `v3.3.0` transactions through `MinterGateClient` using native `BigInt` (`1 coin = 10^18 pip`). Public endpoint URLs for Mainnet (`chainId: 1`) and Testnet (`chainId: 2`) are listed in [API overview and network endpoints](https://docs.minter.network/api#networks).

## Installation and wallet generation

Install the package in Node.js 20.19.0+, Bun, Deno, or a browser bundler project:

```bash
npm init -y
npm install @minter-network/tx-core
npm install -D tsx
```

Save this example as `prepare.mts` and run `npx tsx prepare.mts`. It creates two Testnet addresses and stores the mnemonic, recipient, and epoch in a local `.env.testnet` file with mode `0600`. Keep that file private.

```typescript
import { writeFileSync } from "node:fs";
import { deriveWalletFromMnemonic, generateWalletMnemonic } from "@minter-network/tx-core";

const statusResponse = await fetch("https://testnet.minter.network/status.json", {
  redirect: "error",
  cache: "no-store",
});
if (!statusResponse.ok) throw new Error("Testnet manifest is unavailable");
const status = await statusResponse.json();
if (
  status.state !== "ok" || status.public_api_ready !== true ||
  status.minter_chain_id_byte !== 2 || !/^minter-testnet-[0-9]{6}$/.test(status.chain_id)
) {
  throw new Error("Public Testnet is not ready");
}

const mnemonic = generateWalletMnemonic(128);
const wallet = deriveWalletFromMnemonic(mnemonic, 0);
const recipient = deriveWalletFromMnemonic(mnemonic, 1);
try {
  writeFileSync(".env.testnet", [
    `MINTER_MNEMONIC="${mnemonic}"`,
    `MINTER_RECIPIENT=${recipient.address}`,
    `MINTER_TESTNET_EPOCH=${status.chain_id}`,
    "",
  ].join("\n"), { encoding: "utf8", mode: 0o600, flag: "wx" });
  console.log("Testnet funding address:", wallet.address);
  console.log("Recipient:", recipient.address);
} finally {
  wallet.privateKey.fill(0);
  recipient.privateKey.fill(0);
}
```

## Public Testnet faucet funding

Pass your `Mx...` address to the public Testnet faucet (`https://faucet.testnet.minter.network`, `chainId: 2`) to dispense `1,000 MNT` (`coinId: 0`). Public Testnet endpoints (`https://gate-api.testnet.minter.network/v2`, `https://explorer.testnet.minter.network/`, and the epoch manifest `https://testnet.minter.network/status.json`) are isolated from Mainnet (`chainId: 1`).

> **[warn] Monthly full reset and cross-epoch replay**
> On the 1st of each month the public Testnet resets completely to a new monthly epoch `minter-testnet-YYYYMM`, wiping all balances, custom coins, pools, and transaction history while restarting account `nonce` counters from `0`. Service keys (treasury, faucet hot wallet, generator) rotate on every epoch, whereas `chainId` stays `2` (`0x02`) across epochs: if a user reuses the same `Mx...` address in a later epoch and funds it again, a transaction signed in an earlier epoch can be replayed. Generate a fresh disposable test mnemonic per epoch, keep Mainnet keys separate, and check `https://testnet.minter.network/status.json` for the active `chain_id` and `first_block_hash`.

## Signing and broadcasting `Send (0x01)`

After the faucet payout is confirmed, save the next example as `send.mts` and run `npx tsx --env-file=.env.testnet send.mts`. It checks the epoch, sends `25.50 MNT` to the second address, and prints an Explorer link after the transaction commits. If confirmation stalls, look up the printed hash before trying again.

#### TypeScript (@minter-network/tx-core)

```typescript
import {
  CHAIN_ID,
  MinterGateClient,
  buildSendTx,
  deriveWalletFromMnemonic,
  isValidMxAddress,
  parsePip,
  signTx,
} from "@minter-network/tx-core";

const { MINTER_MNEMONIC: mnemonic, MINTER_RECIPIENT: recipient, MINTER_TESTNET_EPOCH: epoch } = process.env;
if (!mnemonic?.trim() || !recipient || !isValidMxAddress(recipient) ||
    !epoch || !/^minter-testnet-[0-9]{6}$/.test(epoch)) {
  throw new Error("Load .env.testnet from the wallet setup step");
}

const noRedirect: typeof fetch = (input, init) => fetch(input, { ...init, redirect: "error" });
const gate = new MinterGateClient({
  baseUrl: "https://gate-api.testnet.minter.network/v2",
  fetchImpl: noRedirect,
});

async function checkEpoch() {
  const response = await noRedirect("https://testnet.minter.network/status.json", { cache: "no-store" });
  if (!response.ok) throw new Error("Testnet manifest is unavailable");
  const status = await response.json();
  if (status.state !== "ok" || status.public_api_ready !== true ||
      status.minter_chain_id_byte !== CHAIN_ID.TESTNET || status.chain_id !== epoch) {
    throw new Error("Testnet epoch is unavailable or changed. Prepare a new test wallet after a reset.");
  }
  const node = await gate.getStatus();
  if (node.network !== epoch || node.catching_up !== false) {
    throw new Error("The public Testnet node does not match the wallet epoch");
  }
}

await checkEpoch();
const wallet = deriveWalletFromMnemonic(mnemonic, 0);
try {
  const nonce = await gate.getNextNonce(wallet.address);
  const unsignedTx = buildSendTx(
    { coinId: 0, to: recipient, valuePip: parsePip("25.50") },
    { nonce, chainId: CHAIN_ID.TESTNET, gasPrice: 1, gasCoin: 0 },
  );
  const { signedRawTxHex, txHash } = signTx(unsignedTx, wallet.privateKey);
  await checkEpoch();
  console.log("Transaction hash:", txHash);
  const mempool = await gate.sendTransaction(signedRawTxHex);
  if (String(mempool.code) !== "0") {
    throw new Error(`CheckTx rejected (${mempool.code}): ${mempool.log}`);
  }

  const receipt = await gate.waitForTransaction(txHash);
  console.log("Committed:", receipt.hash, "height:", receipt.height, "code:", receipt.code);
  console.log("Explorer:", `https://explorer.testnet.minter.network/transactions/${receipt.hash}`);
} finally {
  wallet.privateKey.fill(0);
}
```

#### cURL

```bash
GATE_URL="https://gate-api.testnet.minter.network/v2"

# 1. Inspect active Testnet epoch and account balances in pip
curl -sS "https://testnet.minter.network/status.json"
curl -sS "${GATE_URL}/address/${TESTNET_ADDRESS:?Set your Testnet address}"

# 2. Estimate the fee for a chainId=2 Send vector (12.5 MNT; coinId 0, gasCoin 0)
curl -sS "${GATE_URL}/estimate_tx_commission/0xf8840102018001a0df80946fac4d18c912343bf86fa7049364dd4e424ab9c088ad78ebc5ac62000094696e766f6963653a746573746e65742d64656d6f8001b845f8431ba00b00e01747dddf76b52bd275d2762fccb161f35e6a7073cf06a4dd0d812cc4d7a0293cd5da784f7fd75cac1bf0c7ac2302932dac8930c2cd1161f632904a85d3d1"

# 3. Read the receipt using the hash printed by send.mts
curl -fsS "${GATE_URL}/transaction/${TESTNET_TX_HASH:?Set the hash from send.mts}"
```

> **[info] Finality:** `POST /v2/send_transaction` validates mempool admission (`CheckTx`) only; finality occurs after block commit (`DeliverTx`) with `code === "0"`.

## Paying fees in non-BIP coins

When an account holds `0 BIP`, set `gasCoin` to the numeric ID of a liquid coin such as `1993` (`USDTE`) or `1902` (`HUB`). The node converts the fee through the coin's `BIP` swap pool or CRR reserve inside the same transaction and adds `1` gas unit (the transaction is rejected if pool or reserve liquidity is insufficient). Full gas accounting rules are specified in [Execution, gas and fees](https://docs.minter.network/protocol/execution-and-fees#gas-coin). When transferring the full balance of the coin selected as `gasCoin`, query `gate.estimateTxCommission(signedRawTxHex)` beforehand and leave a margin for pool price changes between estimation and block commit.
