Time to read: 1 min
Conversion with node and console
This section explains how to try the Powpeg mechanism using your Rootstock node and a command line.
General Requirements
- You need to be in full control of your BTC private key.
- You need a BTC Wallet properly configured using said private key.
- [Only for release process] You need an Rootstock node up and running, with the RPC interface enabled, and the personal and eth modules enabled
BTC to RBTC conversion
How to perform a peg-in.
Warning
Read the lock requirements
- With your Bitcoin address, send a BTC transaction to the Rootstock Federation Address.
- Using your preferred BTC block explorer (e.g. Blocktrail), follow your transaction and wait the stipulated time.
- Convert the private key to Rootstock format with this tool: https://github.com/rsksmart/utils), and write down your Rootstock account information.
- Then use the Rootstock Testnet Explorer
or Rootstock Mainnet Explorer
to see your RBTC balance.
Remember that Rootstock addresses must start with
0x
.
RBTC to BTC conversion
How to perform a peg-out.
Warning
Read the release requirements
- Add your obtained Rootstock private key to your Rootstock node.
Replace
RSKConvertedPrivateKey
,RSKNode
andRSKNodePort
and run this command:$ curl -X POST --data '{"method":"personal_importRawKey", "params":["<RSKConvertedPrivateKey>", "<passPhraseToEncryptPrivKey>"], "jsonrpc":"2.0", "id":1}' http://<RSKNode>:<RSKNodePort>
- Unlock your account for transfers.
Replace
RSKAddress
,passPhraseJustUsedToEncryptPrivKey
,RSKNode
andRSKNodePort
and run:$ curl -X POST --data '{"method":"personal_unlockAccount", "params":["<RSKAddress>", "<passPhraseJustUsedToEncryptPrivKey>", ""], "jsonrpc":"2.0", "id":1}' http://<RSKNode>:<RSKNodePort>
- Transfer your desired amount.
Replace
RSKAddress
,valueToReleaseInWeis
,RSKNode
andRSKNodePort
and run:$ curl -X POST --data '{"method":"eth_sendTransaction", "params":[{"from": "<RSKAddress>", "to": "0x0000000000000000000000000000000001000006", "gasPrice": 59240000, "gas": 44000, "value": <valueToReleaseInWeis>}], "jsonrpc":"2.0", "id":1}' http://<RSKNode>:<RSKNodePort>
- Wait the stipulated time and check your BTC balance.