Bitcoin Forum
September 26, 2024, 02:58:22 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Armory / Re: How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Arm on: January 05, 2018, 04:14:31 AM
I found the solution, and I am posting here in case it could be useful for others in the future, too:

Basically, I didn't manage to import properly earlier because  "Segwit only allows compressed public keys, but Armory only uses uncompressed public keys. In order to use Segwit, Armory will compress the keys on-the-fly, but the export will still give you the uncompressed version."

So I simply needed to get the compressed version of the private key (namely, the compressed WIF private key) from the (uncompressed) WIF private key that Armory was giving me.
I used a local version of bitaddress.org (taken from the repo at  https://github.com/pointbiz/bitaddress.org  )  to do that.

Credits and thanks to achow101 for telling me that (and full detailed instructions in case other people might need it):
https://bitcointalk.org/index.php?topic=2689834.msg27503623#msg27503623


Edit:  Typo.
2  Bitcoin / Development & Technical Discussion / Re: How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core? on: January 05, 2018, 02:54:15 AM
Yes, it did work!   Smiley

Much gratitude for your help and for sharing your knowledge, achow101.  You made my day!

And I feel I understand a tiny bit more of the workings of Bitcoin now.  Still a long way to go...
3  Bitcoin / Development & Technical Discussion / Re: How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core? on: January 05, 2018, 02:37:27 AM
Perfect!  It looks exactly like what I was needing!

I should be able to convert the private keys from the uncompressed to the compressed format using a local version of bitaddress.org - now that I know this is what I need to do!

Will do that and report here.
Many thanks for your much appreciated help.
4  Bitcoin / Development & Technical Discussion / Re: How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core? on: January 05, 2018, 02:24:18 AM
If that may help, this is for a P2SH-P2WPKH private key exported from Armory v0.96.3.99 (0.96.4 RC1).
5  Bitcoin / Development & Technical Discussion / Re: How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core? on: January 05, 2018, 02:13:36 AM
But if I try to import the private key of a segwit (P2SH-P2WPKH) address into Core (through the console) it gives me a legacy "1" address that doesn't correspond to my segwit address
Use addwitnessaddress on the legacy address that is imported. Then rescan the blockchain.

I had tried to do that on the console ("addwitnessaddress [the_legacy_address_that_appeared]", but it gave me the error:

"Public key or redeemscript not known to wallet, or the key is uncompressed (code -4)"

(I did not rescan, as it seemed the addwitnessaddress command wasn't successful.)

There's something I do not know or understand about segwit's functionning, and so I have no clue how to progress forward with that.
What would that mean?
6  Bitcoin / Development & Technical Discussion / Re: How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core? on: January 04, 2018, 06:58:51 PM
Honestly you shouldn't bother with this until Core 0.16 is released with proper segwit support, better to keep using legacy addresses only in Core until 0.16, at least that is what im doing. And once 0.16 is released, Bech32 addresses (the proper segwit ones that begin with bc1) will be easily manageable through the GUI, or that is what I hope for. Once we have bc1 then we can ignore the ones that begin with 3.

I agree with you, however the issue is that I am already using a segwit (P2SH-P2WPKH) address from another wallet, and I want to import that into Core.

I'm sure there must be a way to do that with Core 0.15.1, I just have to find out how!
7  Bitcoin / Development & Technical Discussion / Re: How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core? on: January 04, 2018, 05:28:04 PM
Some more specific information, gathered from another thread where goatpig wrote:

Quote
P2SH-P2WPKH is a standard SW script type described in the BIP, any SegWit compliant wallet is expected to support that script type to claim compliance. What you need to figure out is how to instruct the receiving wallet [the Bitcoin core client] to instantiate the associated address as nested SW.
Source:  https://bitcointalk.org/index.php?topic=2679892.msg27479932#msg27479932

It seems that what I need to do is to have the Bitcoin core client to "instantiate the associated address as nested SW".

How could I do that?
8  Bitcoin / Armory / Re: How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Arm on: January 04, 2018, 05:20:36 PM
Thank you for that, I understand more now, and I know in which direction to continue searching.
9  Bitcoin / Development & Technical Discussion / How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core? on: January 04, 2018, 04:37:18 PM
How to transfer/import a segwit (P2SH-P2WPKH) address into Bitcoin Core, so that I can send the coins from Bitcoin Core (the original client)?

I have created Segwit addresses (P2SH-P2WPKH) on another client (Armory) and received funds there, and now I want to "import" those Segwit addresses with the Bitcoin core client, so that I can spend the funds from the Bitcoin core client.  I couldn't find how to do that.

With legacy (P2PKH) addresses ("1-" addresses), I can simply import the private keys into Bitcoin core, and it all works fine.  But if I try to import the private key of a segwit (P2SH-P2WPKH) address into Core (through the console) it gives me a legacy "1" address that doesn't correspond to my segwit address - and which doesn't contain my coins, obviously.

What am I doing wrong here, and how could I do that?

Any help would be much appreciated.
10  Bitcoin / Armory / Re: How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Arm on: January 04, 2018, 04:14:17 PM
This is a question for the recipient wallet, not the origin wallet, i.e. ask Core. I have no experience with the Core wallet, so I can't help you there.

Thank you for your answer - much appreciated.

(Just to clarify, when I mention "Core", I mean the original Bitcoin client/wallet - i.e. the same one that Armory requires to run.)

I somehow thought that being able to export private keys in a standard way was a regular feature of Armory, so that we could use them elsewhere in case of need.

My understanding of Segwit is far from being complete, and so I had the impression that I needed to extract or export something else from Armory (the redeem script?) in order to input it in the Bitcoin core client - but I cannot find where/how to export that.


Edit:  Typo.


11  Bitcoin / Armory / Re: How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Arm on: January 03, 2018, 12:47:35 AM
Are you wanting to move your coins and are basically stuck without a working Armory setup currently?

No, Armory works fine.  I actually believe it is the best available wallet at the moment.

I want to do this for 2 main reasons:
1- To be sure to be able to successfully export my keys/addresses and access coins in case I run into an issue with Armory in the future.  That is, to not be 100% dependent (or "stuck") on a single system, or a single point of failure.
2- To be able to export specific keys/addresses into other bitcoin forks' clients (after having emptied those keys, obviously).

Good to hear!

Sound reasoning, most come in here after a problem has reared its head rather than before.
For Core, honestly 0.16 should resolve the issue.
But for now you might be able to try Electrum. I know by default it opts for bech32 addresses and native (rather than nested) segwit, but I swear I read that it can use/import P2SH-P2WPKH with a bit of poking.


Word of warning on your second point, if an adversary gets ahold of one of your private keys AND has your root public key they can generate backwards and forward on the chain to get the other private keys within that wallet too. Make sure your empty that wallet, not just the keys.
Relevant posts from goatpig here and here.

That's a very important piece of information I didn't know.  Thank you for that.  Cycling wallets (and not only keys), and obviously making proper backups, is an important step to do beforehand then.

I prefer to avoid using Electrum, at least for now, as I do not like the idea of being dependent and a third-party server to access coins.  I think that running full nodes is healthier for the entire network.  But thank you for suggesting that.

Back to my initial question:
How to import a segwit P2SH-P2WPKH keys into bitcoin core, as it is right now?

I am sure that goatpig knows if/how this can be done, but I do not want to send him a direct PM to ask.  It is best if those discussions are public so that it can help other people in the future too.  Smiley
12  Bitcoin / Armory / Re: How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Arm on: January 03, 2018, 12:02:02 AM
Are you wanting to move your coins and are basically stuck without a working Armory setup currently?

No, Armory works fine.  I actually believe it is the best available wallet at the moment.

I want to do this for 2 main reasons:
1- To be sure to be able to successfully export my keys/addresses and access coins in case I run into an issue with Armory in the future.  That is, to not be 100% dependent (or "stuck") on a single system, or a single point of failure.
2- To be able to export specific keys/addresses into other bitcoin forks' clients (after having emptied those keys, obviously).

13  Bitcoin / Armory / Re: How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Arm on: January 02, 2018, 11:43:13 PM
Yes, I've done that, and it simply gave me another segwit (3-) address, which was not my original segwit address.  The way I understand it (and I might be wrong) is that Core can generate a segwit address from a legacy (1-, P2PKH) address, and that's what "addwitnessaddress" does.

So it seems to me that I have to find the "original" legacy (P2PKH) address that Armory used to generate a segwit address?  But I couldn't find it anywhere within Armory.

I am pretty sure that it is possible to import segwit (P2SH-P2WPKH) addresses into Bitcoin Core, based on the conversation between goatpig and achow101 here:  https://bitcointalk.org/index.php?topic=2605402.0
14  Bitcoin / Armory / How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Arm on: January 02, 2018, 08:59:01 PM
How to transfer/import a segwit (P2SH-P2WPKH) address (and private key) from Armory to Bitcoin Core?

How can I transfer & import the private key of a segwit (P2SH-P2WPKH) address from Armory into Bitcoin core?

I searched quite a fair bit and couldn't manage to do it.

I can export the private key (Base58) from Armory just fine, but when I import that into Bitcoin core (through the console) it gives me a legacy "1" address that doesn't correspond to my segwit address.

It seems I need to use the command "addwitnessaddress", but I do not know which legacy "1" address I should specify, nor how to find it.


What am I doing wrong here, and how could I do that?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!