Skip to content

Latest commit

 

History

History
129 lines (95 loc) · 5.19 KB

user-manual.md

File metadata and controls

129 lines (95 loc) · 5.19 KB

Dogecoin <-> Ethereum bridge - User guide

WARNING: THIS IS AN ALPHA RELEASE. SOME FEATURES STILL HAVE TO BE IMPLEMENTED AND THERE MIGHT BE BUGS. JUST USE IT WITH COINS YOU ARE OPEN TO LOSE.

To get a general overview of the system, go to: https://github.com/dogethereum/docs

A "user" of the bridge can do the following operations:

  • Lock (Doge -> Eth).
  • Transfer doge tokens (Eth -> Eth).
  • Unlock (Eth -> Doge).

The "alpha" bridge uses Dogecoin mainnet and Ethereum Rinkeby testnet.

The doge token is deployed at address 0xd41d4b54013a622eaec3d6f35072b6a5e827c0ef

Prerequisites

In order to use the bridge you will need:

  • An Ethereum node running on rinkeby testnet with its blockchain up to date and rpc interface enabled.
geth --rinkeby --syncmode=fast --cache=2048 --rpc --rpcapi="db,eth,net,web3,personal" console
  • Some Rinkeby Eth to pay the network transaction fees. You can get some on the faucet.
  • A Dogecoin core node running on mainnet with its blockchain up to date and rpc interface enabled (Other doge wallets won't work).
dogecoindOrDogecoinQtCommand -server -rpcuser=yourDogeRpcUser -rpcpassword=yourDogeRpcPassword 

Converting Dogecoin doges to Ethereum doge tokens.

Before you start go to the dogethereum tools directory:

cd dogethereum-tools

Send 8 doges to ethereum

node user/lock.js --dogeuser yourDogeRpcUser --dogepassword yourDogeRpcPassword --value 800000000

The minumum value to lock is 3 doges.

This will:

  • Select an operator that is available to receive 8 doges.
  • Create, sign and broadcast a doge tx sending 8 doges to the operator.
  • Print your private key. You need to use it later on to get the doge tokens.

Expected output:

Lock 8 doges.
Connected to dogecoin node!
Initiating lock... 
Locking 8 doges to address OperatorDogeAddress using operator 0xoperatorPublicKeyHash
Sent doge tx ...
User private key : 0xYourPrivateKey
User eth address : 0xYourEthAddress
Total locked 8 doges.
Lock Done.

Import your private key

The doge tokens will be assigned to the ethereum address controlled by the private key that signed the 1st input of the dogecoin transaction. That is the private key that you obtained on the previous step. In order to use your doge tokens, you need import your private key to ethereum:

node user/import-doge-key-to-eth.js --privateKey 0xYourPrivateKey

Check you have received the tokens

To check you have received the tokens (after ~20 minutes):

node user/print-balances.js --address 0xYourEthAddress

There are fees you have to pay for doing a lock. If you sent 8 doges, you will receive 6 doge tokens because the bridge fee is 2% of the locked amount, minimum 2 doges. On top of that, you will be charged ~1 doge to pay the doge tx fee.

Congratulations! You converted doges to doge tokens!

Using the doge tokens

If you received tokens by locking doges, you may want to use them. The first thing is to make sure you have some eth balance on the address where you have the doge tokens (you probably don't) to pay eth tx fees. You can send some eth to that address using your preferred ethereum rinkeby wallet. In case you don't have one, you can use this command (the sender address should have some rinkeby eth) :

node user/transfer-eth.js --sender 0x... --receiver 0xYourEthAddress --value 10000000000000000

To transfer 0.01 doge tokens to another user:

node user/transfer-tokens.js --sender 0xYourEthAddress --receiver 0xDestinationEthAddress --value 1000000

If you received tokens from another user: You can use them in your preferred rinkeby wallet as any other ERC-20 token

Converting Ethereum doge tokens back to Dogecoin doges.

To send 5 doge tokens back to doge:

node user/unlock.js --sender 0xYourEthAddress --receiver yourDogeAddress --value 500000000

The minumum value to unlock is 3 doge tokens. There are fees you have to pay for doing an unlock. The bridge fee is 1% of the unlocked amount, minimum 1 doge. On top of that ~1.5 doge will be deducted to pay the doge tx fee. If you sent 5 doge tokens you will receive ~2.5 doges.

After ~2 minutes you will receive a doge tx to yourDogeAddress.

You can check you received the doges using your Dogecoin wallet or https://dogechain.info

Congratulations! You converted doge tokens to doges!

Dogethereum tools reference documentation

For a full command reference:

  • See User tools reference.
  • On the command line:
    node user/whatever-command-you-want-to-use.js --help