본문으로 바로가기
Time to read: 1 min
전체 문서 색인은 llms.txt

How to access native pegout funds with a private key

This guide explains how to access the Bitcoin funds received from a native pegout on Atlas Bridge when you hold the wallet's private key directly (for example a MetaMask account), rather than using a hardware wallet.

Why use a private key to access funds?

If you signed the native pegout with a wallet where you hold the private key directly, you don't need a derivation path to find your destination address. The private key itself is enough, once converted to the right format, you can import it directly into Electrum as a single address.

If instead you signed with a hardware wallet (Trezor or Ledger), use Accessing the address derived by a native pegout instead, which browses your account using the derivation path.

Prerequisites

Getting your wallet private key

Follow these steps to export your private key from your wallet.

Using MetaMask

Step 1: Open the MetaMask wallet in your browser. You can find this in your browser's extensions.

Step 2: Click the menu icon on the right.

Step 3: Choose "Account details".

Step 4: Click the "Export private key" button.

Step 5: Fill out your wallet password and click "Confirm".

Step 6: Copy the private key and click "Done".

Converting your private key to WIF

Before you can import the key into Electrum, convert it into a Wallet Import Format (WIF). A WIF private key is just another way of representing your original private key, it can always be converted back to its original format.

For more info on WIF, see the Bitcoin Wiki.

Using Rootstock Utils (Recommended)

Rootstock Utils converts keys between Bitcoin and Rootstock formats offline, without exposing your key to a website.

Step 1: Clone the Rootstock Utils project.

Step 2: Follow the steps explained in the README.

Step 3: Install webpack:

npm install webpack@4.46.0 -g
npm i webpack-cli@3.3.12 -g
npm install
webpack

[Optional] you will need npm to install webpack:

npm install --save-dev webpack

Step 4: Run webpack:

webpack

Step 5: Open the file in your browser:

./build/index.html

Step 6: In the generated application, add your private key and convert it to WIF.

Using LearnMeABitcoin

IMPORTANT: We discourage using websites on the internet for this. If your private key is exposed, your funds are also exposed. Use the offline option, Rootstock Utils, whenever possible.

Step 1: Visit https://learnmeabitcoin.com/technical/wif.

You will find Ruby code and a tool to convert the private key into a WIF.

Step 2: Paste the private key from Getting your wallet private key into the "Private Key" field.

Step 3: Choose the network: Mainnet or Testnet.

Step 4: Choose the compressed option true.

Step 5: Copy the WIF value.

IMPORTANT: Using the Ruby code directly is highly recommended over the web form. This code requires the checksum.rb and base58_encode.rb functions shown below.

Download the checksum file here. Download the base58_encode file here.

require_relative 'checksum'
require_relative 'base58_encode'

privatekey = "<YOUR_32_BYTE_PRIVATE_KEY_HEX>"
network_prefix = "80" # Mainnet ("ef" for Testnet)
compressed_suffix = "01" # Omit for uncompressed keys
extended = network_prefix + privatekey + compressed_suffix

puts wif

Import the private key into Electrum

Electrum is used to verify the destination address and view the funds received from your native pegout.

Step 1: Download Electrum for your OS from the website.

NOTE: If you need to run Electrum on Testnet, execute the following commands:

cd /Applications/Electrum.app/Contents/MacOS
./run_electrum --testnet

Step 2: Start with the "Create New Wallet" option.

Step 3: Fill out a new wallet name and click "Next".

Step 4: Choose "Import Bitcoin addresses or private keys" and click "Next".

Step 5: Fill out the WIF value of the private key and click "Next".

Step 6: Create a new wallet password and click "Next".

In this screen, you will see the address that received your native pegout BTC funds.

Troubleshooting: pegout completed but balance is zero

Your BTC may have arrived even when Electrum shows a zero balance. Work through these checks in order:

  1. Confirm the transaction on a bitcoin block explorer using the destination Bitcoin address from Atlas' transaction status.
  2. Confirm the WIF value you imported matches the private key used to sign the native pegout.
  3. Confirm you selected the correct network (Mainnet or Testnet) both when converting to WIF and when launching Electrum.
  4. If the balance is still wrong, delete the Electrum wallet file and repeat the import with the correct WIF value.
Keep your private key safe

Anyone with your private key or WIF value can spend the funds at that address. Prefer the offline Rootstock Utils conversion method, avoid pasting your private key into websites, and never share it with anyone.

최종 수정: 작성일: 작성자: Owanate Amachree