Skip to main content
This guide sends a transaction on the Sundial L2 testnet and explains how funds move between L1 and L2. Your browser wallet’s Send button builds transactions for the settlement L1, not for the Sundial L2. To transact on the L2 you build a transaction against the L2 node. The midgard command-line tool does this for you.

Send a transaction with the CLI

1

Build the CLI

From a checkout of sundial-monorepo:
Commands below use node dist/bin.js. By default they connect to http://localhost:3000. Pass --endpoint https://rpc.testnet.sundialprotocol.com to use the public testnet node.
2

Create a wallet

This prints a new addr_test1… address and saves the wallet locally under the name you gave it.
3

Fund it

Paste the address into the faucet, then check the balance:
4

Send

The amount is in sBTC. The command prints the transaction hash.
5

Confirm it was accepted

Submission only queues the transaction. The node validates it a moment later. If the lookup says “Not found”, wait a few seconds and try again.
If a command can’t connect, check the node first:
The CLI reference lists every command.

Build transactions in your own code

The L2 uses a Cardano-style transaction format, so libraries such as Lucid Evolution can build transactions. The difference is the provider:
  1. Read spendable outputs from GET /utxos on the L2 node.
  2. Build and sign the transaction. The fee follows the node’s formula: 44 lovelace per byte plus 155,381.
  3. Submit the hex-encoded transaction to POST /submit.
  4. Poll GET /tx?tx_hash=… until the node returns it.
See the Transactions API and the Midgard SDK.

Deposit from L1

A deposit is an L1 transaction that sends tokens to the L2’s deposit contract and names the L2 address to credit. The block whose time interval covers the deposit’s inclusion time must include it, and your funds then appear on L2. Build it with the SDK: see Constructing a deposit.

Withdraw to L1

A withdrawal is an L1 transaction that posts a withdrawal order: which L2 output to withdraw, and which L1 address to pay.
  1. The order is included in an L2 block, which removes the output from the L2 ledger.
  2. The block waits out the maturity period and is merged.
  3. The order is paid out from the reserve to your L1 address.
Build it with the SDK: see Constructing a withdrawal.

If an operator ignores your transaction

Post it on L1 as a transaction order. The block covering its inclusion time must include it. See Posting a transaction order and how inclusion times work.