Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: flexiroute on January 11, 2018, 08:54:53 PM



Title: How to construct transactions starting with bech32 addresses?
Post by: flexiroute on January 11, 2018, 08:54:53 PM
Today I was just browsing coinsecrets.org and I came up with these
https://blockchain.info/tx/82545e2be329109eabf4ebf93362e20f88beb0b29f14f7657fde3f95091bf6a2
In these transaction I saw addresses starting with'bc1q' these type of transaction is strange to me . will anyone teach me how do I create these type of transactions step by step?


Title: Re: How to construct transactions starting with bech32 addresses?
Post by: achow101 on January 11, 2018, 11:21:27 PM
Read BIPs 173: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki and 141: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki


Title: Re: How to construct transactions starting with bech32 addresses?
Post by: Xynerise on January 11, 2018, 11:23:24 PM
Today I was just browsing coinsecrets.org and I came up with these
https://blockchain.info/tx/82545e2be329109eabf4ebf93362e20f88beb0b29f14f7657fde3f95091bf6a2
In these transaction I saw addresses starting with'bc1q' these type of transaction is strange to me . will anyone teach me how do I create these type of transactions step by step?
Those a Bech32 segwit addresses defined in BIP 173 by Peter Wuille
https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki

With bc1 addresses your transactions are 38% smaller than that of legacy transactions of the same input/output.
Eg for 1 input and 2 outputs, a legacy (address starts with 1) transaction is 226 bytes, but a Bech32 transaction is just 141vbytes.

Right now only Electrum supports the creation of wallets with this address type (select "native segwit" when you're setting up)
Also, it's not backwards compatible, meaning wallets without segwit support won't be able to send funds to this type of address.


Title: Re: How to construct transactions starting with bech32 addresses?
Post by: flexiroute on January 12, 2018, 04:35:30 AM
Thanks for the reply bro but I just wanted to know how to create op_return transaction with bech32 addresses.