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.
Use this prompt to get started quickly.
Prerequisites
- Dart SDK 3.11+ / Flutter 3.x+
- Rust toolchain (
rustup, cargo, rustc). The bark_bitcoin package compiles its Rust core at build time using Dart’s Native Assets feature.
Getting started
Install the SDK
dart pub add bark_bitcoin
Then run:Create a wallet
Configure the wallet for signet and initialize it.import 'dart:io';
import 'package:bark_bitcoin/bark_bitcoin.dart';
Future<void> main() async {
// Use a known test mnemonic (generate your own for real use)
final mnemonic =
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
// Configure for signet
final 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,
daemonFastSyncIntervalSecs: null,
daemonSlowSyncIntervalSecs: null,
);
// Create a data directory
final dataDir = Directory('./bark_db');
dataDir.createSync(recursive: true);
// Create the wallet
final wallet = await Wallet.create(
mnemonic: mnemonic,
config: config,
datadir: dataDir.path,
forceRescan: false,
);
}
Back up the mnemonic securely. It is the only way to recover your wallet.
Get a receiving address
Generate an Ark address to receive funds.final address = await wallet.newAddress();
print("Ark address: $address");
Send some signet sats to this address using the faucet. Check your balance
Sync the wallet with the Ark server and read your balance.sync is a reserved keyword in Dart. The method is named sync_() with a trailing underscore.
await wallet.sync_();
final balance = await wallet.balance();
print("Spendable: ${balance.spendableSats} sats");
Next steps
Source and examples
Full Dart source and example projects on GitLab.
How Ark works
Learn about the protocol powering your wallet.