Title: P2SH addresses: need some help understanding (0.01BTC reward) Post by: allyouracid on September 14, 2015, 06:55:42 PM Hey guys,
it was just today that I recalled that there is something like "Bitcoin addresses starting with a 3". And as I like 3 more than 1, I thought it would be "cool" to have a similar address, created by vanitygen, as I already own, but starting with a 3. I already own one with the pattern "FuckUp… (https://blockchain.info/address/1FuckUpmVUxwHZH1vkLNkEYB8dTvsS782E1)", and so I created one with "3FuckUp… (https://blockchain.info/address/3FuckUpFfo28hxXb89C19Az2kfGh7JhGY4)". After successful creation, I got this output: Code: 3FuckUp Code: importprivkey 5Th15I5n0tMyPr1v47eK3yS0noN3edT0TrY1fItW0rKstH4nKy4 Code: addmultisigaddress 1 [\"19JFoRyGrUVN18qGhBSwvj6Cpt8pzTpUCn\"] Now, as the blockchain on my computer is still more than one year behind, I don't want to wait seven weeks to find out myself when the blockchain has completely downloaded, eventualls, I have some questions:
Can anyone help? As a thank you, I'm offering 0.01 BTC for the first one who can answer me this in a way I can understand it. It's not much, but people do things here for way less. :) Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: achow101 on September 14, 2015, 07:06:07 PM The 3 addresses are p2sh which are not created the way you did it. In fact, I don't know if there is a way to create vanity p2sh addresses.
Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: allyouracid on September 14, 2015, 07:26:56 PM The 3 addresses are p2sh which are not created the way you did it. In fact, I don't know if there is a way to create vanity p2sh addresses. Hm, maybe I confused things. I should have inserted the command I used to create them.Quote allyourbase@shitbook ~/Source/bitcoin-related/vanitygen $ ./vanitygen -i -F script There are only two addresses being involved in the creation process (both in bold print). Creating addresses starting with "3" is accomplished using "-F script" parameter. 3FuckUp Difficulty: 478688906 Pattern: 3FuckUp s P2SHAddress: 3FuckUpFfo28hxXb89C19Az2kfGh7JhGY4 Address: 19JFoRyGrUVN18qGhBSwvj6Cpt8pzTpUCn Privkey: 5Th15I5n0tMyPr1v47eK3yS0noN3edT0TrY1fItW0rKstH4nKy4 Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: achow101 on September 14, 2015, 08:24:16 PM nvm, I missed a part of your OP.
You did mostly everything correctly. Bitcoin Core doesn't have a GUI for p2sh transactions, so you will need to create the transaction and sign it through the console. You can also get another client that allows p2sh stuff (also called multisig) I don't think that mycelium allows you to use p2sh addresses. Also, you should NEVER post your private keys here. Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: DannyHamilton on September 14, 2015, 08:26:28 PM The first digit is a version number that tells wallets that are sending bitcoins to you what sort of script to build in the transaction output.
Therefore, the answer to your question: "Are both addresses connected in some way?" is Yes. They both share the same private key. The version 1 address tells any wallet that is sending bitcoins to you to create an output with the following P2PKH script: OP_DUP OP_HASH160 hash_of_your_public_key OP_EQUALVERIFY OP_CHECKSIG Where the wallet that is sending to you extracts the hash_of_your_public_key from your version 1 address by converting from base58 back to binary and striping off the version number and the checksum. Your wallet then recognizes any version 1 scripts that include hash_of_your_public_key, and can provide the signature necessary to spend the outputs that are encumbered with that script. The version 3 address tells any wallet that is sending bitcoins to you to create an output with the following P2SH script: OP_HASH160 hash_of_the_P2PKH_you_see_above OP_EQUAL Where the wallet that is sending to you extracts the hash_of_the_P2PKH_you_see_above from your version 3 address by converting from base58 back to binary and striping off the version number and the checksum. Your wallet then recognizes any version 3 scripts that include hash_of_the_P2PKH_you_see_above, and can provide BOTH the P2PKH script and the signature necessary to spend the outputs that are encumbered with that script. Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: allyouracid on September 14, 2015, 08:44:05 PM Also, you should NEVER post your private keys here. No worries - did you try to "read" the key? ;)Code: 5Th15I5n0tMyPr1v47eK3yS0noN3edT0TrY1fItW0rKstH4nKy4 The first digit is a version number that tells wallets that are sending bitcoins to you what sort of script to build in the transaction output. This pretty much tells me what I wanted to know.Therefore, the answer to your question: "Are both addresses connected in some way?" is Yes. They both share the same private key. The version 1 address tells any wallet that is sending bitcoins to you to create an output with the following P2PKH script: OP_DUP OP_HASH160 hash_of_your_public_key OP_EQUALVERIFY OP_CHECKSIG Where the wallet that is sending to you extracts the hash_of_your_public_key from your version 1 address by converting from base58 back to binary and striping off the version number and the checksum. Your wallet then recognizes any version 1 scripts that include hash_of_your_public_key, and can provide the signature necessary to spend the outputs that are encumbered with that script. The version 3 address tells any wallet that is sending bitcoins to you to create an output with the following P2SH script: OP_HASH160 hash_of_the_P2PKH_you_see_above OP_EQUAL Where the wallet that is sending to you extracts the hash_of_the_P2PKH_you_see_above from your version 3 address by converting from base58 back to binary and striping off the version number and the checksum. Your wallet then recognizes any version 3 scripts that include hash_of_the_P2PKH_you_see_above, and can provide BOTH the P2PKH script and the signature necessary to spend the outputs that are encumbered with that script. As both of you helped me a lot to understand what I can / can't do, and why this is the case, I'm asking both of you to leave me your BTC address here, so I can send the promised .01 - it's not much, but consider it a thank you for your efforts. :) .edit: Dr. Who is just great. Awaiting the next season! Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: achow101 on September 14, 2015, 08:48:37 PM Also, you should NEVER post your private keys here. No worries - did you try to "read" the key? ;)Here is my address 16mT7jrpkjnJBD7a3TM2awyxHub58H6r6Z Also, when you want to spend the Bitcoin from your p2sh address, you will need to use the createrawtransaction, signrawtransaction, and sendrawtransaction to create, sign, and broadcast it. When using createrawtransaction, be careful because you can end up not sending the change to a change address and accidentally making that become part of the fee. Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: allyouracid on September 14, 2015, 08:52:34 PM Also, you should NEVER post your private keys here. No worries - did you try to "read" the key? ;)Here is my address 16mT7jrpkjnJBD7a3TM2awyxHub58H6r6Z Also, when you want to spend the Bitcoin from your p2sh address, you will need to use the createrawtransaction, signrawtransaction, and sendrawtransaction to create, sign, and broadcast it. When using createrawtransaction, be careful because you can end up not sending the change to a change address and accidentally making that become part of the fee. I thought about trying to write a piece of code which automates the process for me. I'll use a more or less empty wallet, with only very small amounts, just to make sure. But thanks for the disclaimer - can't be stressed enough, also for anyone else reading this. Tx sent: https://blockchain.info/tx/baee75e61bb4e261730c2938ac489ae8ce11042a5b1d979b25be05c2a576567c Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: DannyHamilton on September 14, 2015, 09:33:15 PM As both of you helped me a lot to understand what I can / can't do, and why this is the case, I'm asking both of you to leave me your BTC address here, so I can send the promised .01 - it's not much, but consider it a thank you for your efforts. :) No need to send me anything. I'm happy to help out wherever I can. Just choose from the following:
.edit: Dr. Who is just great. Awaiting the next season! Yep. It starts in just a few days. If the production accepted bitcoin somehow, or if I knew of any of the actors or staff that used bitcoin, I'd suggest sending my share of the 0.01 BTC to them. Unfortunately, I don't know of any way to do that. Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: allyouracid on September 14, 2015, 09:51:47 PM No need to send me anything. I'm happy to help out wherever I can. Just choose from the following: That's what I'm doing, anyway - online and in real life. :)
Quote
What a wonderful idea - you just reminded me to do a donation AND use Bitcoin for something practical. To be honest, the last time I actually used Bitcoin for anything (besides trading) was quite some time ago. Shame on me for that. .edit: Dr. Who is just great. Awaiting the next season! Yep. It starts in just a few days. If the production accepted bitcoin somehow, or if I knew of any of the actors or staff that used bitcoin, I'd suggest sending my share of the 0.01 BTC to them. Unfortunately, I don't know of any way to do that. Title: Re: P2SH addresses: need some help understanding (0.01BTC reward) Post by: allyouracid on September 20, 2015, 05:44:08 PM knightdk, DannyHamilton: now, several days later, I want to thank you again for your help. It has really motivated me to wrap my head around raw transactions, and to get to know the "inner workings" of Bitcoin a bit better. Result: my very first successful raw transaction from said 3FuckUp address - without any fuckup! :D
https://blockchain.info/address/3FuckUpFfo28hxXb89C19Az2kfGh7JhGY4 https://blockchain.info/tx/8c2d600f0cb0d6715fc364c254fd46577ed729e01a98cf6ae3190bea78c8b5f2 (Please ignore the names of the used "vanity" Bitcoin addresses; they resulted from myself playing with the vanitygen tool and they reveal absolutely nothing [I hope] about my character, heh). Transaction received! |