> ## 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 Ark on signet

Signet is a bitcoin test network where coins are free and plentiful. It provides a good opportunity to test Ark without risking real money.

In this tutorial you will use `bark` to send and receive signet coins using the Ark protocol.

## 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 signet wallet">
    The first step is to create a new signet wallet. You need to tell the wallet the URL of your Ark server and where it can find chain data.

    <Note>
      Use `bark --help` to see what the command-line program can do. For example, when you want to create a wallet, running `bark create --help` will give you more info.
    </Note>

    Esplora is the easiest chain source to configure. But you can also use your own signet node if you prefer.

    <Tabs>
      <Tab title="Esplora">
        Don't switch the esplora instance. We are running a version that includes package relay which will be [merged in soon](https://github.com/Blockstream/electrs/pull/119).

        ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
        bark create --signet --ark ark.signet.2nd.dev --esplora esplora.signet.2nd.dev
        ```
      </Tab>

      <Tab title="bitcoind (cookie)">
        This requires `bitcoind` v29.0 or greater. Your node must use the `-txindex` option.

        ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
        bark create --signet --ark ark.signet.2nd.dev --bitcoind <url-to-your-bitcoin-node> --bitcoind-cookie <path-to-your-cookie>
        ```
      </Tab>

      <Tab title="bitcoind (user/pass)">
        This requires `bitcoind` v29.0 or greater. Your node must use the `-txindex` option

        ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
        bark create --signet --ark ark.signet.2nd.dev --bitcoind <url-to-your-bitcoin-node> --bitcoind-user <username> --bitcoind-pass <password>
        ```
      </Tab>
    </Tabs>

    <Tip>
      **Getting an error about unexpected datadir contents?**

      If you see an error like `Datadir has unexpected contents: ~/.bark/db.sqlite`, you have an old wallet from previous testing. While we're in beta, wallets are typically not backward compatible between versions, so you'll need to remove the old data and create a fresh wallet:

      ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
      rm -rf ~/.bark
      ```

      Then run the `bark create` command above again.
    </Tip>
  </Step>
</Steps>

## Board the Ark and see your balance increase

<Steps>
  <Step title="Check your balance">
    Let's check your balance.

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

    Oh, you are broke! Let's fix that!
  </Step>

  <Step title="Get your Ark address">
    To receive money on Ark you need to share your Ark address which you can find using the following command.

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    bark address
    ```
  </Step>

  <Step title="Get sats from the faucet">
    You can get sats using [our signet faucet](https://signet.2nd.dev/). You will need to authenticate using your GitHub
    account and provide the address you obtained above.

    <Frame caption="signet.2nd.dev">
      <img src="https://mintcdn.com/second-0659a37d/8VZedF7eKiQd6Pfy/images/faucet.jpg?fit=max&auto=format&n=8VZedF7eKiQd6Pfy&q=85&s=8d12d5a250b9086b35876f1cd0e0631d" alt="Screenshot of the Ark signet faucet interface" width="1117" height="1551" data-path="images/faucet.jpg" />
    </Frame>
  </Step>

  <Step title="Confirm your funds">
    Check your balance again to confirm you have received the funds.

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

    Congratulations! You have boarded the Ark. Notice that you received the balance instantly and you didn't need to pay any transaction fees.
  </Step>
</Steps>

## Inspect your VTXOs

Your Ark wallet manages [VTXOs](/learn/vtxo) (virtual transaction outputs) instead of regular UTXOs. You can inspect your newly received VTXO.

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

You should see something like:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  {
    "id": "7d53e2c1e57c4c40dbe942c9a040c95e92db7c4486b2faf9163804097fa165bc:0",
    "amount_sat": 59888,
    "policy_type": "pubkey",
    "utxo": "7d53e2c1e57c4c40dbe942c9a040c95e92db7c4486b2faf9163804097fa165bc:0",
    "user_pubkey": "025577f6f44237f4c334b50c257c8feab6ff89d5591db2aff0ffee5c7bef7c03db",
    "server_pubkey": "02f0f358c1b6173ddecec1ad06b42d3762f193e6ff98a3e112292aec21129f9f6b",
    "expiry_height": 271138,
    "exit_delta": 12
  }
]
```

## Refresh in a round

VTXOs have a [limited lifetime](/learn/lifetime) and must be periodically refreshed in a [round](/learn/rounds). Our signet Ark server runs a round every 30 seconds for testing, but be aware that production servers will run rounds much less frequently. When you run the `refresh` command, you have to wait until the next round starts.

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

Run `bark vtxos` again to confirm your old VTXO has been replaced by a new one with `policy_type` set to `round`.

In the current implementation users must refresh coins manually, but any production-quality wallet will handle this automatically.

## Spend your money and buy a treat for Byte

<Steps>
  <Step title="Create an order">
    We'd like you to buy our mascot, Byte, a treat. You can order one in our [signet test store](https://signet.2nd.dev/store).

    <Frame caption="signet.2nd.dev/store">
      <img src="https://mintcdn.com/second-0659a37d/Dul0-LNCv3q1_9fs/images/store.jpg?fit=max&auto=format&n=Dul0-LNCv3q1_9fs&q=85&s=91628febfd8103bb3aba71a4c530ec64" alt="Screenshot of the Ark signet store" width="1231" height="1145" data-path="images/store.jpg" />
    </Frame>
  </Step>

  <Step title="Pay the invoice">
    After creating an order, the shop will give you a BOLT11
    invoice, which can be paid using the following command.

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

    You can use `bark` to pay:

    * a BOLT11 invoice using Lightning
    * an LNURL using Lightning
    * a bitcoin address for an on-chain payment
    * an Ark address for a user in the same Ark
  </Step>
</Steps>

## Getting your money out, aka off-boarding

You can offboard your funds 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](/learn/offboard) in the Learn section.

## Share your feedback

You've now completed testing the full lifecycle of transactions on Ark—we're excited to see what applications you come up with! [Let us know](https://community.second.tech) if there's any more guides you'd like to see, and please share any feedback on the developer experience.
