How do I sweep funds from my bc1 bech32 segwit address I generated from a paper wallet?

-1

Is there a easy tutorial on how to sweep a bc1 segwit address? I know electrum can sweep private keys, but has anyone ever really tried it and wrote a tutorial on it?

I'm afraid of sending some coins to a bc1 paper wallet. I'm just looking for a tutorial or even a video of someone actually sweeping it.

Patoshi パトシ

Posted 2018-02-05T21:54:06.687

Reputation: 8 911

Answers

1

As Bitcoin core v0.16.0 released You can import Bech32 Segwit address as @Willtech Answer.

importprivkey "privkey" ( "label" ) ( rescan )

First Make sure that you are running the correct bitcoin core version

using getnetworkinfo

bitcoin-cli getnetworkinfo

{
  "version": 160000,
  "subversion": "/Satoshi:0.16.0/",
  "protocolversion": 70015,
  "localservices": "000000000000040d",
  "localrelay": true,
  "timeoffset": 0,
  "networkactive": true,
  "connections": 5
}

Now set address type to bech32 in your bitcoin.conf file

addresstype=bech32

so when "importing" a new private key, it creates a totally new wallet file? why cant it add it to an existing wallet? Also does this "import" know to import the 3 derivatives of addresses? 1xxx, 3xxx, and bc1xxx from a single private key?

  • No it doesn't create an new wallet file, it will just add it to your existing wallet file.

This way it should work 100% anyway if it didn't work. you still create your transaction manually and sign it using your private key.

Adam

Posted 2018-02-05T21:54:06.687

Reputation: 3 215

seems like its not matured yet, as that tutorial seems pretty complicated.Patoshi パトシ 2018-02-05T22:33:56.633

@Patoshi That tutorial is far more complicated than it needs to be for your question.Willtech 2018-02-28T02:34:52.127

You were right guys, but that was before the release of Bitcoin 0.16.0 I made an edit.Adam 2018-02-28T07:33:44.093

1

How to import private keys into Bitcoin Core (from a paper wallet or elsewhere)

In Bitcoin Core, you can use the importprivatekey command.

Once you have your private key, guard it very carefully keeping it very secure and, do the following to import into Bitcoin Core:

  1. Open Bitcoin Core.
  2. Go to Help --> Debug.
  3. Go to the Console tab.
  4. type: importprivatekey "{private key}" "{label optional}"
  5. Create a new wallet backup.

Done. Note that you do not need to wait for Bitcoin Core to update before importing your private key. However, not all funds may show up in your wallet until it is completely up to date.

Hopefully, you have encrypted your wallet with a good passphrase that you will remember.

Usage:

>importprivkey "privkey" ( "label" ) ( rescan )

Adds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup.

Arguments:

  1. "privkey" (string, required) The private key (see dumpprivkey)
  2. "label" (string, optional, default="") An optional label
  3. rescan (boolean, optional, default=true) Rescan the wallet for transactions

Note: This call can take minutes to complete if rescan is true, during that time, other rpc calls may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.

Examples:

Dump a private key
> dumpprivkey "myaddress"

Import the private key with rescan
> importprivkey "mykey"

Import using a label and without rescan
> importprivkey "mykey" "testing" false

Import using default blank label and without rescan
> importprivkey "mykey" "" false

Willtech

Posted 2018-02-05T21:54:06.687

Reputation: 2 657

so when "importing" a new private key, it creates a totally new wallet file? why cant it add it to an existing wallet? Also does this "import" know to import the 3 derivatives of addresses? 1xxx, 3xxx, and bc1xxx from a single private key?Patoshi パトシ 2018-02-28T03:25:27.817

1@Patoshi As Adam has noted in his answer, you need to ensure you are using the correct version of Bitcoin Core for bc1 addresses. The rescan (defaults to true) takes care of finding funds on addresses. No, not a new wallet file.Willtech 2018-02-28T08:35:59.850

Don't have to worry about derivation path that generates an infinity of completely different address?Patoshi パトシ 2018-02-28T15:15:25.307

1@Patoshi as I mentioned in my answer "set address type to bech32 in your bitcoin.conf file" so you get bech32 address, not the legacy one. Try to import it and see if you see your Bitcoins. You will not lose anything.Adam 2018-02-28T17:43:21.000