Title: To Create a Segwit (P2SH) Manually Post by: DUPONDIUS on May 08, 2020, 05:14:26 PM Hello. I'm collecting information for to create a Segwit Wallet Manually. In theory it should be possible to do this with pencil and paper, but the help of a scientific calculator would come in handy. What do you think? Thanks. Title: Re: To Create a Segwit Wallet Manually Post by: odolvlobo on May 08, 2020, 06:19:59 PM When you write "wallet", do you mean "address"?
I'm not an expert on segwit, but you might start here: https://en.bitcoin.it/wiki/Segregated_Witness Title: Re: To Create a Segwit Wallet Manually Post by: DUPONDIUS on May 08, 2020, 07:44:36 PM We want to create a multi-signature address with 2 components.
The first step is to generate the private keys and the public keys (addresses). These are two public keys. > 1NGJoYzwfMotjjBuZZ5H4BujcxGZMQDMoW (private key 1) > 1L3pUofp8EYX7uXVFy2gNSBTanmdC8sRWe (private key 2) We would take the private keys from both addresses (public key) and we would have to combine them. (private key 1) & (private key 2) = multi-signature address (P2SH) How would you do that without using software? Title: Re: To Create a Segwit Wallet Manually Post by: SeaBits on May 08, 2020, 09:05:11 PM We want to create a multi-signature address with 2 components. The first step is to generate the private keys and the public keys (addresses). These are two public keys. > 1NGJoYzwfMotjjBuZZ5H4BujcxGZMQDMoW (private key 1) > 1L3pUofp8EYX7uXVFy2gNSBTanmdC8sRWe (private key 2) We would take the private keys from both addresses (public key) and we would have to combine them. (private key 1) & (private key 2) = multi-signature address (P2SH) How would you do that without using software? It seems like this has been discussed in the past with other types. Take a look at this post: https://bitcointalk.org/index.php?topic=919430.0 (Post #6) TLDR: It will take you a very long time to do it manually. If you're trying to create an address to prove something to yourself I guess you could try but I would recommend using an air-gaped address generator like bitaddress.org or similar site. Head over the to their github page, download the code and run it on your own computer with the internet off. This would save you some time and get a guaranteed end result. Title: Re: To Create a Segwit (P2SH) Manually Post by: DUPONDIUS on May 08, 2020, 09:23:19 PM Thanks for the link. Title: Re: To Create a Segwit (P2SH) Manually Post by: HCP on May 08, 2020, 11:12:58 PM Have you had a read of the SegWit Wallet Development Guide? https://bitcoincore.org/en/segwit_wallet_dev/
It lists all of the steps required for the creation of each type of address... the section on "Complex Script Support" mentions MultiSig: https://bitcoincore.org/en/segwit_wallet_dev/#complex-script-support Title: Re: To Create a Segwit (P2SH) Manually Post by: pooya87 on May 09, 2020, 02:48:10 AM We want to create a multi-signature address with 2 components. (private key 1) & (private key 2) = multi-signature address (P2SH) i think you should start by first learning what bitcoin scripts are so that a lot of your mistakes and confusions go away. for starters P2SH is not equal to multi-signature. it is simply a pay to script hash type of script that can have any type of script. https://en.bitcoin.it/wiki/Script if you want to use a script that is "unlocked" by requiring multiple signature and with SegWit then your best option is using a P2WSH script type with a redeem script that is a standard OP_2 pub1 pub2 OP_2 OP_CHECKMULTISIG script. Title: Re: To Create a Segwit (P2SH) Manually Post by: baro77 on May 09, 2020, 09:21:39 AM Hi @DUPONDIUS
can I ask why manually? Btw, I don't know how strong is your background in SCRIPT (the language) and locking/unlocking scripts, anyway my suggestions would be: 1) don't do it manually unless you have a huge amount of time, patience, concentration.... but to be honest, even with them I'm not sure your idea is feasible 2) if you have a so strong commitment to that, try to understand as deeply as you can the context of your challenge. I'm sure there are a lot of better and more complete sources, but if you want here it is a recap I did some times ago about relations occurring between various locking/unlocking scripts (I think its usefulness -if any- relies on being a quite compact summary, maybe helping you not getting lost while you go deeper thanks to more authoritative authors): https://medium.com/@baro77/btc-locking-and-unlocking-scripts-cheatsheet-ff6d515447de PS Just one more thing. When I read: Quote We would take the private keys from both addresses (public key) and we would have to combine them. the word "combine" reminded me about linearity of Schnorr signatures... always because i don't know your previous knowledge, were you thinking to something like that? If not, never mind.(private key 1) & (private key 2) = multi-signature address (P2SH) Title: Re: To Create a Segwit Wallet Manually Post by: bob123 on May 09, 2020, 11:19:35 AM The first step is to generate the private keys and the public keys (addresses). These are two public keys. > 1NGJoYzwfMotjjBuZZ5H4BujcxGZMQDMoW (private key 1) > 1L3pUofp8EYX7uXVFy2gNSBTanmdC8sRWe (private key 2) In addition to what pooya87 said, an address is not the same as a public key. This all seems a little bit weird for me. This might be the case of a XY problem (https://en.wikipedia.org/wiki/XY_problem). What exactly do you want to achieve ? A 2 out of 2 multisig ? And why do you want to do it without any computer ? Don't you trust your software or hardware ? Do you distrust any random number generator, or what specifically ? Title: Re: To Create a Segwit (P2SH) Manually Post by: DUPONDIUS on May 09, 2020, 06:17:44 PM can I ask why manually? The best way to learn something is to do it. What exactly do you want to achieve ? A 2 out of 2 multisig ? And why do you want to do it without any computer ? Don't you trust your software or hardware ? Do you distrust any random number generator, or what specifically ? I want 2 multising wallet. I don't trust my shadow... Title: Re: To Create a Segwit (P2SH) Manually Post by: pooya87 on May 10, 2020, 03:15:27 AM The best way to learn something is to do it. I don't trust my shadow... not trusting just because you feel paranoid doesn't make any sense specially since all the good projects that also happen to be popular like bitcoin core and electrum are 100% open source so there is no room for not-trusting since you can see everything the tool does. but if your purpose is to learn more about bitcoin and how things work under the hood then that's a different thing. if it is the learning you seek then tell us if you have any background so far, for example how much do you know about transactions, their serialization, scripts, OP codes, cryptography and public/private key pairs? i can write a step by step guide starting from 2 private keys all the way down to the scripts they create and their corresponding addresses but you have to know the basics i mentioned. Title: Re: To Create a Segwit (P2SH) Manually Post by: DUPONDIUS on May 10, 2020, 05:19:53 PM I will study the links you have provided me. Thank you all. P.S. The world is for the bold. |