Ramps class.
Boarding
To board, you send bitcoin to your wallet’s boarding address. The address locks funds to the same script shape as the default payment script. That script has a collaborative spending path (your key and the operator’s key) and a unilateral path (your key alone, after a timelock).1
Generate a boarding address
Get a boarding address from your wallet:
2
Send bitcoin to the address
Fund the address from any Bitcoin wallet and wait for the transaction to confirm. Until the deposit settles,
getBalance() reports it under boarding.3
Settle the deposit
The running wallet settles confirmed deposits by itself. It checks for them every minute, so you don’t need to call anything.Calling
onboard on that wallet races the automatic settlement, and both can try to spend the same deposit. If the wallet settled the deposit first, onboard throws No boarding utxos available after deducting fees. Call onboard only on a wallet created with settlementConfig: false. That setting also turns off automatic renewal.4
Receive the virtual output
The operator broadcasts a commitment transaction that spends the deposit. The virtual output then appears in your wallet, spendable like any other.
Offboarding
Offboarding spends your virtual outputs in a batch swap, and the commitment transaction pays your destination address. It needs the operator. If the operator is unavailable, use a unilateral exit instead.1
Set the destination and amount
2
Request the offboard
The SDK picks the virtual outputs to spend. The operator charges a fee for the onchain output, and To deliver exactly
offboard takes that fee out of amount, so the destination receives amount minus the fee.amount to the destination, call offboardExact
instead. The wallet then pays the fee on top of amount:3
Receive onchain bitcoin
The operator broadcasts a commitment transaction that pays the destination address. Once it confirms, you can spend the destination output onchain.
Unilateral Exit
Every Arkade output carries a unilateral spending path: your key alone, after a relative timelock. For a virtual output, taking that path means broadcasting a chain of presigned transactions yourself and paying miner fees on each one, so it costs more than offboarding. Use it only if the operator is unavailable.1
Create and fund an onchain wallet
Unrolling broadcasts each presigned transaction in the chain, and each broadcast pays miner fees from an onchain wallet you control:Send bitcoin to this address to cover the fees.
2
Unroll the virtual output
Unrolling publishes the presigned transactions in sequence, with confirmation waits between steps:After the exit transactions confirm,
getBalance() reports the output under
unrolled.3
Wait for the timelock
After unrolling, wait for the CHECKSEQUENCEVERIFY (CSV) relative timelock to expire. Only then can you spend the output. On mainnet, the delay is currently 605,184 seconds, about 7 days.
wallet.arkProvider.getInfo() returns it as unilateralExitDelay.4
Claim the output
Once the timelock expires, claim your bitcoin:
See Unilateral Exit for path requirements, timelocks, and fees.