RSK Smart Bitcoin

RSK Smart Bitcoin

Note: RSK was formerly known as Rootstock

RSK Smart Bitcoin can be accessed with the following coin types:

EnvironmentCoin TypeFaucet
RSK Productionrbtc
RSK Testnettrbtchttps://faucet.rsk.co/

Enterprise fee address

1 2 3 4 5 ENTERPRISEID=585c51a5df8380e0e3082e46 curl -X POST \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://app.bitgo-test.com/api/v2/trbtc/enterprise/$ENTERPRISEID/feeAddressBalance

RSK uses the same fee address structure as Ethereum.

Each enterprise has a fee address which will be used to pay for transaction fees on all RSK wallets in that enterprise. The fee address is displayed in the dashboard of the BitGo website, and you must fund it before creating a wallet, address, or sending a transaction. If the enterprise's fee address runs out of funds, you will not be able to create new wallets, addresses, or send transactions until you fund the fee address. You will not be able to use one of your own RSK wallets to fund the fee address if the fee address is too low (because you will not be able to send transactions from your RSK wallet). I It is best to create and fund a non-BitGo RSK account, so you can use it to fund your BitGo enterprise fee address. Any open source RSK wallet can be used to create an account.

Note that the fee address is a single-signature account, and the private key is created and owned by BitGo. You will not be able to send funds out of the fee address once you have sent them in.

There will be a feeAddress field under the CoinSpecific key for RSK wallets. You will use this address to pay the fees for creating transactions and addresses.

Generating wallets

1 2 3 4 5 6 7 8 9 10 11 12 bitgo .coin('trbtc') .wallets() .generateWallet({ label: 'My Test Wallet', passphrase: 'secretpassphrase1a5df8380e0e30', enterprise: '5612c2beeecf83610b621b90964448cd', }) .then(function (wallet) { // print the new wallet console.dir(wallet); });
1 2 3 4 5 6 7 8 LABEL="My Test Wallet" PASSPHRASE="secretpassphrase1a5df8380e0e30" curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d "{ \"label\": \"$LABEL\", \"passphrase\": \"$PASSPHRASE\" }" \ http://$BITGO_EXPRESS_HOST:3080/api/v2/trbtc/wallet/generate

Before you can use an RSK wallet, it must be initialized on the RSK blockchain. When you create an RSK wallet, BitGo sends a transaction on the RSK network in order to generate the wallet.

Until the initialization transaction is confirmed, the wallet is not ready for use, and the receive address is not exposed in the API. This is to protect users from losing funds by sending to a wallet that does not exist on the network.

Warning: Do not use an RSK wallet while it is being initialized or you may lose funds.

Creating addresses

1 2 3 4 5 6 7 8 9 10 11 bitgo .coin('trbtc') .wallets() .getWallet({ id: '585c51a5df8380e0e3082e46' }) .then(function (wallet) { return wallet.createAddress(); }) .then(function (newAddress) { // print new address details console.dir(newAddress); });
1 2 3 4 5 WALLET=585c51a5df8380e0e3082e46 curl -X POST \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://app.bitgo-test.com/api/v2/trbtc/wallet/$WALLET/address

RSK address creation requires interactions with the RSK blockchain. In order to deploy a receive address contract, BitGo sends a transaction on the RSK network. Make sure to fund the fee address mentioned above. Like the wallet creation process, a RSK address will not be immediately usable upon creation and so the caller of this function will have to wait for the initialization transaction to be confirmed before attempting to fetch, or send to, the address.

Balances

Smart Bitcoin (RBTC) is the native asset of the RSK blockchain and is pegged 1:1 to BTC. RSK is a smart-contract compatible Bitcoin sidechain and uses the Ethereum Virtual Machine (EVM).

RBTC is used to pay for RSK gas fees like Ether is used to pay for Ethereum gas fees. The base unit of Smart Bitcoin is wei:

  • 1 wei is (10-18) or 0.000000000000000001 RSK.
  • 1 RSK is (1018) or 1000000000000000000 wei (1 quintillion).

Balances are supported in string format: balanceString, confirmedBalanceString, and spendableBalanceString.

Transactions

BitGo's RSK multisig contract currently only supports one sender and one recipient. That means that the sendMany call will only accept one recipient.