Skip to main content

Account Basics

In this tutorial you will learn what Accounts are in Runes3 and how to use them.

Concept

Accounts are the core of Runes3. Accounts are an abstraction that represent a specific Bitcoin address and the UTXOs it owns. They are the main way you interact with the Runes network or query data from the RPC. There are two types of accounts in Runes3:

  • AnonymousAccount:

    const Runes = new Runes3("https://runes.satsignal.io/v1");
    const Account = await Runes.getAccount(
    "bc1pdcy7dw547w8qle3ltc3efulsv2ng66pwy3fwcxpphmn8ghc5sxfsgh72la"
    );

    An anonymous account represents an address whose address you know but private key you don't. This is useful if you want to query data about a specific address, like its rune balance.

    Example: If you wanted to get the Runes balance of an exchange address, you would use an anonymous account.

  • OwnedAccount: This is an address whose private key you own. OwnedAccounts can create and send transactions that mint and etch runes, in addition to extending all the base RPC methods from an AnonymousAccount. There are 3 ways you can create an OwnedAccount:

    Example: If you wanted to mint a new rune, you would use an OwnedAccount.

    • With a private key: You can create an OwnedAccount by passing in its private key.
    • With XVERSE wallet (browser): You can create an OwnedAccount by passing in the "Wallet" object from XVERSE.
    • WITH UNISAT wallet (browser): You can specify that you want to use UniSat as your wallet provider, and Runes3 will communicate with the browser extension on sign requests.
    const Runes = new Runes3("https://runes.satsignal.io/v1");

    //First argument: "priv" | "xverse" | "unisat" -> specifies the authentication method that will be used to sign transactions.
    //Second argument: for "priv" -> the private key, for "xverse" -> the XVERSE wallet object, for "unisat" -> null.
    const Account = await Runes.getOwnedAccount("priv", "<private-key>");
    //"Account" can now mint and Etch runes.