How To Use sign() for the Whitehat Withdrawal

Introduction

This document is intended as a tutorial to explain to users how to use web3.eth.sign() to sign their intent in the ETH chain to have anyone (in this case us) use proxyWithdraw() in the ETC chain and get their withdrawal amount in a beneficiary address in the ETC chain without having to bother syncing it.

The way to achieve this is easy but involves using geth in console mode. If you know how to do that, that’s perfect. If you do not this tutorial will provide screenshots and try to explain everything in a beginner friendly way.

Proxy Withdraw Website

Visit the website for proxyWithdraw(). There you will see some text fields you will need to fill in. They represent the following things:

  1. DAO Token Holder Address: Your address that held the DAO tokens at the time of the hard fork in the main chain from which you would like to withdraw your ETC. You have to make sure that you have the key for this address in your keystore!!
  2. ETC Beneficiary Address: The address in the ETC chain that you would like to receive your portion of the withdrawal. This can also be the deposit address of an exchange so that you don’t have to bother with syncing the ETC chain at all
  3. WHG donation percentage: This should be a number ranging from 0 to 100, representing the percentage that you would like to donate to the WhiteHat Group for all the work they did and have been doing to get these funds back to you and the rest of the community.

alt

Fill in the relevant fields as were described above and as is shown in the screenshot.

That was the easy part. Now we have to use geth in order to obtain the signature which should go to the last field. This is essentially the actual authorization step you as a DAO Token Holder can give us so that we can transfer the funds to you via proxyWithdraw().

Keep the filled in website open in a tab in your browser and skip to the relevant section depending on your OS.

  1. Windows
  2. OSX
  3. Linux

1. Windows

Download the latest stable release of Geth. Go to your Downloads folder and extract geth.

alt

Open the new directory and copy geth.exe

alt

Paste it into the main root directory for convenience. In our case here that is C:\

alt

Download the sign intent script.

alt

After downloading use the same steps you used to extract geth and copy it into the main root directory (C:) but this time do it for sign_intent.js.

Now click on the Start button and type cmd in the ‘Search Programs And Files` bar. When cmd.exe appears click on it.

alt

Now make sure no other ethereum client is running at the same time. If you have mist close it, until we obtain the signature.

Type cd c:\ in order to change the current directory to the main root directory (C:\ in our case)

alt

Now you are in the main root directory. Type the following command to fire up geth in a mode where you can sign your intent to use proxyWithdraw():
geth --preload ./sign_intent.js --maxpeers 0 console

alt

The above command will open geth but in an offline mode just to be on the safe side.

Now you need to copy the exact same values you input in the website.

  1. fromAddress: The address that held the DAO tokens at the time of the hard fork in the main chain from which you would like to withdraw your ETC. You have to make sure that you have the key for this address in your keystore!!
  2. beneficiaryETC: The address in the ETC chain that you would like to receive your portion of the withdrawal. This can also be the deposit address of an exchange so that you don’t have to bother with syncing the ETC chain at all
  3. percentageWHG: This should be a number ranging from 0 to 100, representing the percentage that you would like to donate to the WhiteHat Group for all the work they did and have been doing to get these funds back to you and the rest of the community.

Once you have those decided you can invoke the signIntent function on the console entering those arguments in order in the function like so:
signIntent("0xc967718ac462a3bf0b956659f78c797a838f097f", "0xef11d5fc7e9566f86ce4f0daf72b183c15def0cd", 20)

You can also see it in detail in the following screenshot. When done press the Enter key.

alt

Now you will be prompted for the password of your FromAddress. Type the password and press the Enter Key. Do not worry when you see no letters/stars appearing, the password is not printe dback to the user.

alt

After a successful typing of the password the result we seek will be shown back to you!

alt

Now you need to copy the signature and send it to us. To copy it, right click anywhere on the console and click on “Mark”.

alt

Now you are in marking mode. With your mouse point to the beginning of the signature and while holding the left mouse button drag and select the entire signature. When done press Enter.

alt

Now, after having pressed the Enter Key, the signature is copied in your clipboard. The last step is to give it to us.

Go back to your browser. In the Signature text box you have to paste the copied signature from the console. Then you should press the Withdraw Button.

alt

And that is all! Congratulations! You have managed to sign your intent to perform a Withdrawal in ETC by signing a transaction from your account in the ETH chain. The ETC should arrive shortly on the designated account!

2. OSX

Download the latest Geth stable for MacOSX from here. Go to your Downloads folder and there you should see the downloaded zip archive. Double click on it in order to unzip it and obtain the Geth executable.

alt

Now visit the sign_intent github Gist and download the script.

alt

Copy the sign_intent.js script from inside the unzipped directory, back up to the Downloads directory so that it is at the same level as the geth executable.

alt

Now you have to open a terminal window.

alt

Once in the terminal type the following in order:

  1. cd Downloads
  2. ./geth --preload ./sign_intent.js --maxpeers 0 console

After each command press the Enter key. The above will (1) navigate to the directory where you downloaded geth and (2) open geth in offline mode and load the sign_intent script at the same time.

alt

Once inside geth you need to copy the exact same values you input in the website.

  1. fromAddress: The address that held the DAO tokens at the time of the hard fork in the main chain from which you would like to withdraw your ETC. You have to make sure that you have the key for this address in your keystore!!
  2. beneficiaryETC: The address in the ETC chain that you would like to receive your portion of the withdrawal. This can also be the deposit address of an exchange so that you don’t have to bother with syncing the ETC chain at all
  3. percentageWHG: This should be a number ranging from 0 to 100, representing the percentage that you would like to donate to the WhiteHat Group for all the work they did and have been doing to get these funds back to you and the rest of the community.

Once you have those decided you can invoke the signIntent function on the console entering those arguments in order in the function like so:
signIntent("0xc967718ac462a3bf0b956659f78c797a838f097f", "0xef11d5fc7e9566f86ce4f0daf72b183c15def0cd", 20)

You can also see it in detail in the following screenshot. When done press the Enter key.

alt

Now you will be prompted for the password of your DTH account. Type it and press the Enter Key. The password is not printed in the screen, so do not be alarmed if you do not see any characters while you type.

alt

After typing your password the signature will be calculated and printed back to you.

alt

Now you need to copy the signature and send it to us. In order to do that you have to left click at the beginning of the signature, drag the cursor until the end (before the “) and then press Command Key + C.

alt

Go back to your browser. In the Signature text box you have to paste the copied signature from the console using CMD+V. Then you should press the Withdraw Button.

alt

And that is all! Congratulations! You have managed to sign your intent to perform a Withdrawal in ETC by signing a transaction from your account in the ETH chain. The ETC should arrive shortly on the designated account!

3. Linux

We assume Linux users are a bit more tech-savvy and are not explaining how to download geth and we are also not including any screenshot. Instead we are giving a simple explanation of the process that an average user can use. If you need to know how to install geth in Linux follow the wiki. If you absolutely need screenshots, do check the OSX section as the process should be very similar.

Download the sign_intent script and save it to as sign_intent.js in a directory/folder where you can easily access it from while launching geth.

Then navigate to that directory and launch geth with the following arguments:

geth --preload ./sign_intent.js console

Once inside geth you need to copy the exact same values you input in the website.

  1. fromAddress: The address that held the DAO tokens at the time of the hard fork in the main chain from which you would like to withdraw your ETC. You have to make sure that you have the key for this address in your keystore!!
  2. beneficiaryETC: The address in the ETC chain that you would like to receive your portion of the withdrawal. This can also be the deposit address of an exchange so that you don’t have to bother with syncing the ETC chain at all
  3. percentageWHG: This should be a number ranging from 0 to 100, representing the percentage that you would like to donate to the WhiteHat Group for all the work they did and have been doing to get these funds back to you and the rest of the community.

Once you have those decided you can invoke the signIntent function on the console entering those arguments in order in the function like so:

signIntent("0xc967718ac462a3bf0b956659f78c797a838f097f", "0xef11d5fc7e9566f86ce4f0daf72b183c15def0cd", 20)

At this point you will be prompted for the password of the account that signs the intent (the fromAddress). Type it and press the Enter Key.

Unlock account 0xc967718ac462a3bf0b956659f78c797a838f097f
Passphrase:
["0xef11d5fc7e9566f86ce4f0daf72b183c15def0cd", 20, "0x23a9503e51d42348fd3115d6918c3d63bbb0963305c4a47b1a7856f0674706ac7712f19248707179bf58fe5155b18e1bb7d6b103971b5037b88f20dc64395a3d00"]

As a result you are getting an array, whose third member is the signature we need. Copy that signature, in the above example 0x23a9503e51d42348fd3115d6918c3d63bbb0963305c4a47b1a7856f0674706ac7712f19248707179bf58fe5155b18e1bb7d6b103971b5037b88f20dc64395a3d00 and go back to the browser Tab where the whwithdraw website is still open. Paste it in the signature text box and press the withdraw button.

And that is all! Congratulations! You have managed to sign your intent to perform a Withdrawal in ETC by signing a transaction from your account in the ETH chain. The ETC should arrive shortly on the designated account!