メインコンテンツにスキップ
Time to read: 1 min

BitTasker Wallet SDK on Rootstock

BitTasker is a freelance marketplace on Bitcoin and Nostr. The BitTasker app provides an embedded rBTC wallet for the Rootstock Mainnet.

The open-source @bittasker/wallet-core package is the TypeScript SDK behind that wallet. Install it in your web or mobile app to manage rBTC on Rootstock and route Lightning and Liquid swaps through Boltz. The SDK also supports Rootstock Testnet and Regtest for development.

For the complete API reference, see the wallet-core repository README.

When to use this SDK

Use @bittasker/wallet-core when you need:

  • BIP39/BIP44 HD wallets on Rootstock mainnet, testnet, or regtest
  • rBTC balances, transfers, and transaction history on Rootstock
  • Lightning and Liquid swaps into rBTC through Boltz
  • A TypeScript library for React Native, Capacitor, Ionic, or web

Prerequisites

  • Node.js 18+
  • A BIP39 mnemonic stored securely (never hardcode in source)
  • For testnet work: tRBTC from the faucet

Wallet compatibility

FeatureValue
EIP-55 checksumsYes
Derivation pathm/44'/60'/0'/0/0
Customizable dPathNo
Rootstock networksMainnet (BitTasker app); Wallet SDK also supports Testnet and Regtest
BitTasker app platformsAndroid (Google Play, Zapstore), Web (iOS coming soon)
Roadmap

BitTasker does not currently support MetaMask, hardware wallets, Bitcoin, USDT, or rBTC/USDT swaps. These features are on the roadmap. Check the wallet-core repository for future releases.

Get Started

Installation

npm install @bittasker/wallet-core

Quick Start

Import WalletManager, pass your network and mnemonic, then read balances or send rBTC.

import { WalletManager } from '@bittasker/wallet-core';

const walletManager = new WalletManager({
network: 'testnet',
mnemonic: await getSecureMnemonic(),
});

await walletManager.initialize();

const balances = await walletManager.getBalances();
console.log('rBTC:', balances.rsk.rbtc);

const txHash = await walletManager.rskWallet.send(
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'0.01',
);
console.log('Transaction:', txHash);

Replace getSecureMnemonic() with your app’s secure storage. Load mnemonics from a keystore, OS secure enclave, or equivalent. Do not commit seed phrases to source control.

Read addresses and balances

const addresses = walletManager.getAddresses();
console.log('Rootstock address:', addresses.rsk);

const rskBalance = await walletManager.rskWallet.getBalance();
console.log('Balance:', rskBalance.formatted, 'rBTC');

Custom Rootstock RPC

Point the SDK at your own node or an RPC provider when the default endpoints are not enough.

const walletManager = new WalletManager({
network: 'mainnet',
mnemonic: await getSecureMnemonic(),
rskConfig: {
rpcUrl: 'https://public-node.rsk.co',
explorerApiUrl: 'https://rootstock.blockscout.com/api',
},
});

See Rootstock RPC API for provider options.

Lightning and Liquid swaps

The SDK routes Lightning and Liquid swaps through Boltz. Users hold rBTC on Rootstock as the settlement asset, in the same role L-BTC plays on Liquid in wallets such as Aqua.

const swap = await walletManager.reverseSwapService.createReverseSwap({
amountSats: 100000,
rbtcAddress: walletManager.rskWallet.getAddress(),
walletSigner: walletManager.rskWallet.getWallet(),
});

console.log('Pay this Lightning invoice:', swap.invoice);
console.log('Swap ID:', swap.swapId);

Check swap limits before you build production flows:

const limits = await walletManager.getSwapLimits();
console.log('Lightning min:', limits.lightning.minimal, 'sats');

Security Best Practices

Refer to the BitTasker Wallet Core Security Best Practices.

  • Store mnemonics in secure storage, not in plain text or environment variables checked into git.
  • Validate recipient addresses with ethers.isAddress() before you send rBTC.
  • Test on Rootstock Testnet before mainnet deployments.
  • Report security issues to security@bittasker.com.

Resources

Use these links for the BitTasker app, source code, and npm package.

Next steps

最終更新 作成者: Owanate Amachree