Bitcoin Forum
May 06, 2024, 12:05:24 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: To Create a Segwit (P2SH) Manually  (Read 280 times)
DUPONDIUS (OP)
Jr. Member
*
Offline Offline

Activity: 101
Merit: 9


View Profile
May 08, 2020, 05:14:26 PM
Last edit: May 08, 2020, 07:50:37 PM by DUPONDIUS
 #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.
1714997124
Hero Member
*
Offline Offline

Posts: 1714997124

View Profile Personal Message (Offline)

Ignore
1714997124
Reply with quote  #2

1714997124
Report to moderator
1714997124
Hero Member
*
Offline Offline

Posts: 1714997124

View Profile Personal Message (Offline)

Ignore
1714997124
Reply with quote  #2

1714997124
Report to moderator
1714997124
Hero Member
*
Offline Offline

Posts: 1714997124

View Profile Personal Message (Offline)

Ignore
1714997124
Reply with quote  #2

1714997124
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714997124
Hero Member
*
Offline Offline

Posts: 1714997124

View Profile Personal Message (Offline)

Ignore
1714997124
Reply with quote  #2

1714997124
Report to moderator
1714997124
Hero Member
*
Offline Offline

Posts: 1714997124

View Profile Personal Message (Offline)

Ignore
1714997124
Reply with quote  #2

1714997124
Report to moderator
1714997124
Hero Member
*
Offline Offline

Posts: 1714997124

View Profile Personal Message (Offline)

Ignore
1714997124
Reply with quote  #2

1714997124
Report to moderator
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
May 08, 2020, 06:19:59 PM
Last edit: May 08, 2020, 06:31:43 PM by odolvlobo
 #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

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
DUPONDIUS (OP)
Jr. Member
*
Offline Offline

Activity: 101
Merit: 9


View Profile
May 08, 2020, 07: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?



SeaBits
Member
**
Offline Offline

Activity: 66
Merit: 27


View Profile
May 08, 2020, 09: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://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.
DUPONDIUS (OP)
Jr. Member
*
Offline Offline

Activity: 101
Merit: 9


View Profile
May 08, 2020, 09:23:19 PM
 #5



Thanks for the link.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
May 08, 2020, 11: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

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10550



View Profile
May 09, 2020, 02:48:10 AM
 #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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
baro77
Member
**
Offline Offline

Activity: 90
Merit: 91


View Profile WWW
May 09, 2020, 09: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.
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
May 09, 2020, 11: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 ?

DUPONDIUS (OP)
Jr. Member
*
Offline Offline

Activity: 101
Merit: 9


View Profile
May 09, 2020, 06: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...
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10550



View Profile
May 10, 2020, 03:15:27 AM
 #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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
DUPONDIUS (OP)
Jr. Member
*
Offline Offline

Activity: 101
Merit: 9


View Profile
May 10, 2020, 05:19:53 PM
 #12





I will study the links you have provided me.

Thank you all.



P.S. The world is for the bold.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!