Bitcoin Forum
May 04, 2024, 04:32:53 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to create a Bech32 (bc1) address with PHP standalone?  (Read 298 times)
100bitcoin (OP)
Sr. Member
****
Offline Offline

Activity: 860
Merit: 423


View Profile WWW
April 24, 2019, 11:48:58 PM
 #1

Bitwasp is not of much help in this regard.

Can these addresses be derived from legacy private key?

Any step by step instruction similar to this, will be of great help.

1714840373
Hero Member
*
Offline Offline

Posts: 1714840373

View Profile Personal Message (Offline)

Ignore
1714840373
Reply with quote  #2

1714840373
Report to moderator
1714840373
Hero Member
*
Offline Offline

Posts: 1714840373

View Profile Personal Message (Offline)

Ignore
1714840373
Reply with quote  #2

1714840373
Report to moderator
"You Asked For Change, We Gave You Coins" -- casascius
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
April 25, 2019, 03:14:24 AM
Merited by ABCbits (1)
 #2

Can these addresses be derived from legacy private key?
There is no such thing as "legacy private key". There has always been 1 type of private key, which is a number from 1 to curve's n-1.

Any step by step instruction similar to this, will be of great help.
https://bitcointalk.org/index.php?topic=4992632.0
Step 0 for you would be to get the public key from private key as you would any other time (private key * G).

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
100bitcoin (OP)
Sr. Member
****
Offline Offline

Activity: 860
Merit: 423


View Profile WWW
April 25, 2019, 06:36:07 PM
 #3

Can these addresses be derived from legacy private key?
There is no such thing as "legacy private key". There has always been 1 type of private key, which is a number from 1 to curve's n-1.
Ok. So, what would be the Bech32 (bc1) address derived from the following?

Private Key(Hex): C070A5ECF7138485E5FBC3561BC43D0C3C6052397768B1A7CB996444E8CB917D

Public Key(Compressed): 0228B2993B17F77EB967F3761F72B6B35E4B5C229D5208771F4C9154C42CE7CC13

Any step by step instruction similar to this, will be of great help.
https://bitcointalk.org/index.php?topic=4992632.0
Step 0 for you would be to get the public key from private key as you would any other time (private key * G).
Fantastic guide. Do you know any PHP code, which does this?

Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
April 25, 2019, 07:16:00 PM
Merited by ABCbits (1)
 #4

Ok. So, what would be the Bech32 (bc1) address derived from the following?
Private Key(Hex): C070A5ECF7138485E5FBC3561BC43D0C3C6052397768B1A7CB996444E8CB917D
Public Key(Compressed): 0228B2993B17F77EB967F3761F72B6B35E4B5C229D5208771F4C9154C42CE7CC13
You can use https://segwitaddress.org/bech32/ to test things on the web (it only accepts WIFs which you can convert from hex using bitaddress.org) or use any wallet that supports importing keys and Bech32 addresses.
This would be the resulting address:
Code:
bc1qemht6dcq0cxkam9z7f9lyqwztqtr5c7zszu2f9

Fantastic guide. Do you know any PHP code, which does this?
No, but a search on GitHub returns one result: https://github.com/Bit-Wasp/bech32 (use at your own risk)

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
danda
Full Member
***
Offline Offline

Activity: 201
Merit: 157


View Profile WWW
May 01, 2019, 03:25:39 PM
 #5

Bitwasp is not of much help in this regard.

I'm not sure why you say this.  bitwasp has a bech32 example.

 hd-wallet-derive uses bitwasp and spits out bech32 as well as p2sh and legacy addresses for a given key.  You can check the source if you like.

I do think that bitwasp makes it harder than need be.  See this issue.

mybitprices.info - wallet auditing   |  hd-wallet-derive - derive keys locally |  hd-wallet-addrs - find used addrs
lightning-nodes - list of LN nodes  |  coinparams - params for 300+ alts  |  jsonrpc-cli - cli jsonrpc client
subaddress-derive-xmr - monero offline wallet tool
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!