> ## 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

Once you've [tested on signet](signet), testing on mainnet is the same flow with real bitcoin. In this guide you'll use `bark` to create a mainnet wallet, fund it over Lightning, and make your first payments on Second's mainnet Ark server.

<img src="https://mintcdn.com/second-0659a37d/RWnzip6U_h0J6sse/images/bytes-adventure.svg?fit=max&auto=format&n=RWnzip6U_h0J6sse&q=85&s=cbf99cbab3769af24642c84c113c8446" alt="Bytes adventure" className="block dark:hidden" width="540" height="386" data-path="images/bytes-adventure.svg" />

<img src="https://mintcdn.com/second-0659a37d/RWnzip6U_h0J6sse/images/bytes-adventure-dark.svg?fit=max&auto=format&n=RWnzip6U_h0J6sse&q=85&s=fb761344b0a46a187a1af487acd4cb3c" alt="Bytes adventure" className="hidden dark:block" width="540" height="386" data-path="images/bytes-adventure-dark.svg" />

<Warning>
  Mainnet uses real bitcoin. Start with small amounts while you get familiar with the tooling. Restoring a wallet requires both your mnemonic and backup of its database, so save your mnemonic and [set up continuous backups](/docs/backups) of your wallet's data directory. Don't store more than you're willing to lose.
</Warning>

<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.
</Tip>

## Create your wallet

<Steps>
  <Step title="Verify Bark is installed">
    To ensure that `bark` is installed, run `bark --version`. Follow the [installation instructions](index) if you need to.
  </Step>

  <Step title="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 ark.second.tech
    ```
  </Step>

  <Step title="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,
      "pending_lightning_send_sat": 0,
      "claimable_lightning_receive_sat": 0,
      "pending_in_round_sat": 0,
      "pending_board_sat": 0,
      "pending_exit_sat": null
    }
    ```
  </Step>
</Steps>

## Add bitcoin to your wallet

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

<Steps>
  <Step title="Generate a BOLT11 invoice">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    bark ln invoice "10000 sats"
    ```
  </Step>

  <Step title="Pay the invoice">
    Pay the invoice from your preferred Lightning wallet, and the sats will arrive in your Ark wallet instantly.
  </Step>

  <Step title="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": 271138,
        "exit_delta": 12,
        "state": {
          "type": "spendable"
        }
      }
    ]
    ```
  </Step>
</Steps>

<Tip>
  You can also receive via an Ark payment or by [boarding](/docs/learn/board) instead. Learn more about [Ark payments](/docs/learn/payments).
</Tip>

## Make a Lightning payment

<Steps>
  <Step title="Get a BOLT11 invoice">
    Using a separate Lightning wallet, generate a BOLT11 invoice, or ask a friend or colleague to generate one.
  </Step>

  <Step title="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.
  </Step>
</Steps>

## Make an Ark payment

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

<Steps>
  <Step title="Get an Ark address">
    Ask them for their Ark address.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Verify the payment">
    Run `bark vtxos` again to see your new VTXO (change from the payment).
  </Step>
</Steps>

## Refresh your VTXOs

Your VTXOs have a [limited lifetime](/docs/learn/lifetime) and must be periodically refreshed in a [round](/docs/learn/rounds). Unlike our signet server, which runs a round every 30 seconds 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](/docs/built-with-bark) typically automate refreshes for users.

## Getting your money out, aka off-boarding

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](advanced) instead. For more on how offboarding works, see [Offboarding](/docs/learn/offboard) 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:

<CardGroup cols={2}>
  <Card title="Bark SDK" icon="mobile" href="/docs/bark-sdk">
    For mobile and desktop apps where users hold their own keys.
  </Card>

  <Card title="Barkd" icon="server" href="/docs/barkd">
    For exchanges, e-commerce, and services where you manage bitcoin.
  </Card>
</CardGroup>

## Connection details

Either path connects to Second's mainnet infrastructure using these endpoints:

| Setting    | Value                             |
| ---------- | --------------------------------- |
| Ark server | `ark.second.tech`                 |
| Esplora    | `https://mempool.second.tech/api` |

The `bark` CLI uses the Ark server's default chain source, so you only need to pass `--ark`. Point the SDK, `barkd`, or your own node at the Esplora endpoint when you configure a chain source explicitly.

## 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.
