Use this prompt to get started quickly.
Prerequisites
- Android: API 24+ (Android 7.0), Kotlin 1.9+
- JVM: Linux x86-64 with glibc 2.34+, JDK 17+, Kotlin 1.9+
Getting started
1
Install the SDK
Add the GitLab Maven registry and the Bark dependency to your Gradle project.
- Android
- JVM
In your root In your module In
settings.gradle.kts:build.gradle.kts:AndroidManifest.xml, give your app internet access:2
Create a wallet
Generate a BIP39 mnemonic, configure the signet endpoints, and open the wallet in a data directory.
Wallet.open() creates the wallet on the first launch and reopens it on later ones.- Android
- JVM
Add this code to your app. Get the wallet from a coroutine, for example in your activity:
WalletHolder opens the wallet once per app process and gives every caller the same instance:3
Get a receiving address
Generate an Ark address to receive bitcoin. Add these lines at the end of Run the JVM program or your Android app to print the address. On Android,
main() on the JVM, or after WalletHolder.get() in your coroutine on Android:println() output appears in Logcat. Send some signet sats to this address using the faucet.4
Check your balance
Bark syncs the wallet in the background while it’s open. Call Balance amounts are
sync() when you need an up-to-date balance right away. Add these lines after the previous ones:ULong values.Run the program or app again. It reopens the same wallet and prints your spendable balance in sats.Next steps
Source code
Kotlin bindings source on GitLab.
How Ark works
Learn about the protocol powering your wallet.