> ## Documentation Index
> Fetch the complete documentation index at: https://second.tech/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Test on mainnet

> Connect Bark to Second's mainnet Ark server. Step-by-step guide to create a mainnet wallet, fund it over Lightning, and make real payments with `bark`.

Once you've [tested on signet](https://second.tech/docs/getting-started/bark-cli/signet.md), testing on mainnet is the same flow with real bitcoin, on [Second's mainnet Ark server](https://second.tech/docs/connection-details.md).

![Bytes adventure](https://mintcdn.com/second-0659a37d/RWnzip6U_h0J6sse/images/bytes-adventure.svg?fit=max\&auto=format\&n=RWnzip6U_h0J6sse\&q=85\&s=cbf99cbab3769af24642c84c113c8446)

> [!WARNING]
>
> Mainnet uses real bitcoin. Start with small amounts while you get familiar with the tooling. Your seed phrase alone can recover your balance with the Ark server's cooperation, but it can't restore payment history or the state of any in-progress exits. Save your seed phrase and [set up continuous backups](https://second.tech/docs/backups.md) of your wallet's data directory. Don't store more than you're willing to lose.

> [!TIP]
>
> Building on mainnet? Head to [chat.second.tech](https://chat.second.tech) and ping Neil (982572) to get a dedicated support channel set up for your team. Slack and Signal are also available on request.

## Create your wallet

**1. Verify Bark is installed**

To ensure that `bark` is installed, run `bark --version`. Follow the [installation instructions](https://second.tech/docs/getting-started/bark-cli.md) if you need to.

**2. Create a new mainnet wallet**

Create a wallet pointed at Second's mainnet Ark server.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark create --mainnet --ark https://ark.second.tech
```

**3. Check your balance**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark balance
```

You should see all balances at zero:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "spendable_sat": 0,
  "needs_refresh_sat": 0,
  "pending_lightning_send_sat": 0,
  "claimable_lightning_receive_sat": 0,
  "pending_in_round_sat": 0,
  "pending_board_sat": 0,
  "pending_arkoor_send_sat": 0,
  "pending_offboard_sat": 0,
  "pending_exit_sat": 0
}
```

## Add bitcoin to your wallet

The quickest way to fund your wallet is to send bitcoin from any Lightning wallet.

**1. Generate a BOLT11 invoice**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark ln invoice "10000 sats"
```

**2. Pay the invoice**

Pay the invoice from your preferred Lightning wallet, and the sats will arrive in your Ark wallet instantly.

**3. Confirm your VTXOs**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark vtxos
```

The output will look something like:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  {
    "id": "7d53e2c1e57c4c40dbe942c9a040c95e92db7c4486b2faf9163804097fa165bc:0",
    "amount_sat": 10000,
    "policy_type": "pubkey",
    "user_pubkey": "025577f6f44237f4c334b50c257c8feab6ff89d5591db2aff0ffee5c7bef7c03db",
    "server_pubkey": "02f0f358c1b6173ddecec1ad06b42d3762f193e6ff98a3e112292aec21129f9f6b",
    "expiry_height": 966276,
    "exit_delta": 144,
    "chain_anchor": "0527dd37c19a2084ab99dc8db59e5d527d9cbb62ebb535e9b1c4bf5323c8210c:0",
    "exit_depth": 3,
    "state": {
      "type": "spendable"
    }
  }
]
```

> [!TIP]
>
> You can also receive via an Ark payment or by [boarding](https://second.tech/docs/learn/board.md) instead. Learn more about [Ark payments](https://second.tech/docs/learn/payments.md).

## Make a Lightning payment

**1. Get a BOLT11 invoice**

Using a separate Lightning wallet, generate a BOLT11 invoice, or ask a friend or colleague to generate one.

**2. Pay the invoice**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark send <bolt11-invoice>
```

Replace `<bolt11-invoice>` with the full invoice string. The payment is routed over Lightning, so anyone with a Lightning wallet can receive it.

## Make an Ark payment

If you have a friend or colleague on the same Ark server, you can also make an Ark payment.

**1. Get an Ark address**

Ask them for their Ark address.

**2. Send some sats**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark send <ark-address> "<amount> sats"
```

Replace `<ark-address>` with their Ark address and `<amount>` with the number of sats to send.

**3. Verify the payment**

Run `bark vtxos` again to see your new VTXO (change from the payment).

## Refresh your VTXOs

Your VTXOs have a [limited lifetime](https://second.tech/docs/learn/lifetime.md) and must be periodically refreshed in a [round](https://second.tech/docs/learn/rounds.md). Unlike our signet server, which runs a round every 5 minutes for testing, the mainnet server runs rounds much less frequently, so a refresh may take longer to confirm.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark refresh --all
```

The `bark` CLI requires you to refresh manually. [Wallet apps built on the Bark SDK](https://second.tech/docs/built-with-bark.md) typically automate refreshes for users.

## Getting your money out, aka offboarding

You can offboard your bitcoin back to a regular on-chain UTXO. This is the cheapest and fastest way to leave Ark.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bark offboard --all
```

If the Ark server is uncooperative, you can always perform an [emergency exit](https://second.tech/docs/getting-started/bark-cli/advanced.md) instead. For more on how offboarding works, see [Offboarding](https://second.tech/docs/learn/offboard.md) in the Learn section.

## Start building

Now that you have a feel for how fast payments are across both Lightning and Ark, you're ready to start building. There are two integration paths depending on your use case:

> [card] [Bark SDK](https://second.tech/docs/bark-sdk.md)
>
> For mobile and desktop apps where users hold their own keys.

> [card] [Barkd](https://second.tech/docs/barkd.md)
>
> For exchanges, e-commerce, and services where you manage bitcoin.

## Share your feedback

You've now made some of the first ever Bark transactions on mainnet across both Lightning and Ark. We're excited to see what you build! [Let us know](https://community.second.tech) if there are any more guides you'd like to see, and please share any feedback on the developer experience.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.