Author

Topic: To Create a Segwit (P2SH) Manually (Read 300 times)

jr. member
Activity: 101
Merit: 9
May 10, 2020, 12:19:53 PM
#12




I will study the links you have provided me.

Thank you all.



P.S. The world is for the bold.
legendary
Activity: 3472
Merit: 10611
May 09, 2020, 10:15:27 PM
#11
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.
jr. member
Activity: 101
Merit: 9
May 09, 2020, 01:17:44 PM
#10

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...
legendary
Activity: 1624
Merit: 2481
May 09, 2020, 06:19:35 AM
#9
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. 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 ?
member
Activity: 90
Merit: 91
May 09, 2020, 04:21:39 AM
#8
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.

(private key 1) & (private key 2) =  multi-signature address (P2SH)
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.
legendary
Activity: 3472
Merit: 10611
May 08, 2020, 09:48:10 PM
#7
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.
HCP
legendary
Activity: 2086
Merit: 4361
May 08, 2020, 06:12:58 PM
#6
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
jr. member
Activity: 101
Merit: 9
May 08, 2020, 04:23:19 PM
#5


Thanks for the link.
member
Activity: 66
Merit: 27
May 08, 2020, 04:05:11 PM
#4
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://bitcointalksearch.org/topic/can-you-create-a-bitcoin-address-manually-919430  (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.
jr. member
Activity: 101
Merit: 9
May 08, 2020, 02:44:36 PM
#3
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?



legendary
Activity: 4466
Merit: 3391
May 08, 2020, 01:19:59 PM
#2
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
jr. member
Activity: 101
Merit: 9
May 08, 2020, 12:14:26 PM
#1

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.
Jump to: