Skip to main content

Use this prompt to get started quickly.

CursorOpen in Cursor

Prerequisites

  • Android: API 24+ (Android 7.0), Kotlin 1.9+
  • JVM: OpenJDK 17+, Kotlin 1.9+

Getting started

1

Install the SDK

Add the JitPack repository and the Bark dependency to your Gradle project.
In your root settings.gradle.kts:
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}
In your module build.gradle.kts:
dependencies {
    implementation("com.gitlab.ark-bitcoin.bark-ffi-bindings:bark-android:v0.1.2-beta.29+bark.0.1.0-beta.7")
}
2

Create a wallet

Generate a BIP39 mnemonic, configure the wallet for signet, and initialize it.
import uniffi.bark.*
import java.nio.file.Paths

fun main() {
    // Generate a new mnemonic
    val mnemonic = generateMnemonic()
    println("Mnemonic: $mnemonic")

    // Configure for signet
    val config = Config(
        serverAddress = "https://ark.signet.2nd.dev",
        esploraAddress = "https://esplora.signet.2nd.dev",
        bitcoindAddress = null,
        bitcoindCookiefile = null,
        bitcoindUser = null,
        bitcoindPass = null,
        network = Network.SIGNET,
        vtxoRefreshExpiryThreshold = null,
        vtxoExitMargin = null,
        htlcRecvClaimDelta = null,
        fallbackFeeRate = null,
        roundTxRequiredConfirmations = null
    )

    // Create a data directory
    val dataDir = Paths.get(
        System.getProperty("user.home"), ".bark", "my_wallet"
    )
    java.io.File(dataDir.toString()).mkdirs()

    // Create the wallet
    val wallet = Wallet.create(
        mnemonic = mnemonic,
        config = config,
        datadir = dataDir.toString(),
        forceRescan = false
    )
}
Back up the mnemonic securely. It is the only way to recover your wallet.
On Android, all wallet operations are blocking and must run off the main thread—use Dispatchers.IO with coroutines.
3

Get a receiving address

Generate an Ark address to receive funds.
val address = wallet.newAddress()
println("Ark address: $address")
Send some signet sats to this address using the faucet.
4

Check your balance

Sync the wallet with the Ark server and read your balance.
wallet.sync()

val balance = wallet.balance()
println("Spendable: ${balance.spendableSats} sats")

Next steps