-
Notifications
You must be signed in to change notification settings - Fork 267
BTC SBTC conversion
Meri Herrera edited this page Jul 17, 2018
·
14 revisions
This document describes the 2-way peg mechanism. This is for converting BTC to SBTC to use within the RSK Blockchain and for transfering your SBTC balance back to the BTC network.
- You need to be in full control of your private key
- You need a BTC Wallet properly configured using the previously mentioned private key
- You need an RSK node up and running, with the RPC interface enabled with the personal and eth modules enabled (how do I run an RSK Node?)
- You need to be whitelisted in the RSK network (what's to be whitelisted?)
❗ IMPORTANT the minimum amount to send is 0.01 BTC
- Send a BTC transaction to the Federation Address (check Notes #1).
- Obtain the BTC transaction hash ID
- Open your preferred BTC block explorer (i.e. Blocktrail)
- Search for your BTC transaction (check Notes #2)
- You have to wait a minimum of 100 confirmations plus a minimum of 5 minutes for checking your SBTC balance
- Convert the private key to RSK format using https://utils.rsk.co (this can be run offline), write down your RSK address
- Execute this command (check Notes #3)
$ curl -X POST --data '{"method":"eth_getBalance", "params":["<RSKAddress>"], "jsonrpc":"2.0", "id":1}' http://<RSKNode>:<RSKNodePort>
- Convert the private key to RSK format using https://utils.rsk.co (this can be run offline), you'll obtain a derived RSK private key and your RSK address
- Add your obtained RSK private key to your RSK node:
$ curl -X POST --data '{"method":"personal_importRawKey", "params":["<RSKConvertedPrivateKey>", "<passPhraseToEncryptPrivKey>"], "jsonrpc":"2.0", "id":1}' http://<RSKNode>:<RSKNodePort>
- Unlock your account for transfers:
$ curl -X POST --data '{"method":"personal_unlockAccount", "params":["<RSKAddress>", "<passPhraseJustUsedToEncryptPrivKey>", ""], "jsonrpc":"2.0", "id":1}' http://<RSKNode>:<RSKNodePort>
- Transfer your desired amount
$ curl -X POST --data '{"method":"eth_sendTransaction", "params":[{"from": "<RSKAddress>", "to": "0x0000000000000000000000000000000001000006", "gasPrice": 183000000, "gas": 100000, "value": <valueToReleaseInWeis>}], "jsonrpc":"2.0", "id":1}' http://<RSKNode>:<RSKNodePort>
- Wait 4000 RSK confirmations and then wait at least 10 more minutes for your funds to arrive to your BTC address.
- You can get the Federation Address invoking
getFederationAddress
method of the bridge contract at address:0x0000000000000000000000000000000001000006
(for both: testnet and mainnet). - Check that the first input should spend a P2PKH (pay to public key hash) output.
- Rsk addresses must start with
0x