Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: How to create a Bech32 (bc1) address with PHP standalone?
by
Coding Enthusiast
on 25/04/2019, 19:16:00 UTC
⭐ Merited by ETFbitcoin (1)
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)