<p>While technically it is possible to generate one address from another, after all they are simply representations of public keys, it is strongly discouraged to do so, if you are not the owner of the address (at which point the wallet should provide you with an option to use either format). The problem is that if you send a transaction to a segwit address, that the recipient is not expecting/supporting then they will not recognize the payment.</p>

<p>Now for the apparent aliasing you mention above: the recipient address of the transaction you link to is a <a href="https://bitcoincore.org/en/segwit_wallet_dev/#creation-of-p2sh-p2wsh-address" rel="nofollow noreferrer">P2WSH (pay-to-witness-script-hash)</a> address. <code>cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70</code> is the hash of a script that currently only the owner knows (until an output to that address has been spent). The <code>bc1...</code> representation is the <a href="https://github.com/bitcoin/bips/blob/dd4467d12b811c3e5ee97f3eb5f3a73aa1ec4464/bip-0173.mediawiki" rel="nofollow noreferrer">bech32 encoded</a> <a href="https://github.com/bitcoin/bips/blob/master/bip-0142.mediawiki#specification" rel="nofollow noreferrer">BIP142 address</a>, which includes a checksum and a human readable currency identifier <code>bc</code>. It contains exactly the same information, i.e., a P2WSH script of the form `0 .</p>

CC BY-SA 3.0
2017-09-03T01:12:12.453Z
2017-09-03T01:35:54.323Z
2017-09-03T01:35:54.323Z
cdecker
<p>After 24 aug 2017 starting from block #481824 blockchain DB consist transactions with the segwit-addresses. </p>

<p>For example (have a look to the address, specified in the output):
<a href="https://btc.com/461e8a4aa0a0e75c06602c505bd7aa06e7116ba5cd98fd6e046e8cbeb00379d6" rel="nofollow noreferrer">https://btc.com/461e8a4aa0a0e75c06602c505bd7aa06e7116ba5cd98fd6e046e8cbeb00379d6</a></p>

<p>address
<strong>bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak</strong>
or (how I understand it is the same address, but in another format)
<strong>cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70</strong></p>

<p>I have to notice that only btc.com parsed this output (for example, blocktrail.com or blockexplorer.com couldn't parse this).</p>

<p>In the same time json-rpc of bitcoin-core client couldn't parse this address too. </p>

<p>[vout] => Array
(
[0] => Array
(
[value] => 0.005
[n] => 0
[scriptPubKey] => Array
(
[asm] => 0 cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70
[hex] => 0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70
[type] => witness_v0_scripthash
)
)
)</p>

<p>How we see - no section "addresses" in the section "scriptPubKey" (in case of "legacy" addresses json-rpc returns information about the addresses).</p>

<p>So what I want to ask:</p>

<p>1) What is the difference between 
<strong>bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak</strong>
and
<strong>cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70</strong>
? Is it different formats of 1 address?</p>

<p>2) How could I know hash of legace-address of the followed transaction? Is it possible? May be I have to parse scriptBubKey hash for this?</p>

<p>3) Why bitcoin-core json-rpc doesn't provide this info? I use last version of bitcoin-core client.</p>

<p>Thanks a lot for the any information.</p>

CC BY-SA 3.0
2017-08-31T07:35:03.450Z
I thought segwit addresses starts with 3?
Yoan Arnaudov
CC BY-SA 3.0
2017-08-31T08:33:49.230Z
Native SegWit addresses use the bech32 encoding and start with bc1, for now, most people use SegWit with P2SH addresses that start with 3
alcio
<blockchain><blockchain.info><blockchain-fork>
Is it possible to extract legacy address from segwit address?
Daniil Kamenskiy
# Is it possible to extract legacy address from segwit address?

(Asked by: username_0 on 2017-08-31)

After 24 aug 2017 starting from block #481824 blockchain DB consist transactions with the segwit-addresses.

For example (have a look to the address, specified in the output):
<https://btc.com/461e8a4aa0a0e75c06602c505bd7aa06e7116ba5cd98fd6e046e8cbeb00379d6>

address
**bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak**
or (how I understand it is the same address, but in another format)
**cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70**

I have to notice that only btc.com parsed this output (for example, blocktrail.com or blockexplorer.com couldn't parse this).

In the same time json-rpc of bitcoin-core client couldn't parse this address too.

[vout] => Array
(
[0] => Array
(
[value] => 0.005
[n] => 0
[scriptPubKey] => Array
(
[asm] => 0 cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70
[hex] => 0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70
[type] => witness\_v0\_scripthash
)
)
)

How we see - no section "addresses" in the section "scriptPubKey" (in case of "legacy" addresses json-rpc returns information about the addresses).

So what I want to ask:

1) What is the difference between
**bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak**
and
**cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70**
? Is it different formats of 1 address?

2) How could I know hash of legace-address of the followed transaction? Is it possible? May be I have to parse scriptBubKey hash for this?

3) Why bitcoin-core json-rpc doesn't provide this info? I use last version of bitcoin-core client.

Thanks a lot for the any information.

**Tags:** blockchain, blockchain.info, blockchain-fork

> **Comments:**
> **username_1**: I thought segwit addresses starts with 3?  
> **username_2**: Native SegWit addresses use the bech32 encoding and start with bc1, for now, most people use SegWit with P2SH addresses that start with 3  

---

## 1 answers

### Answer by username_3 on 2017-09-03. Score: 1

While technically it is possible to generate one address from another, after all they are simply representations of public keys, it is strongly discouraged to do so, if you are not the owner of the address (at which point the wallet should provide you with an option to use either format). The problem is that if you send a transaction to a segwit address, that the recipient is not expecting/supporting then they will not recognize the payment.

Now for the apparent aliasing you mention above: the recipient address of the transaction you link to is a [P2WSH (pay-to-witness-script-hash)](https://bitcoincore.org/en/segwit_wallet_dev/#creation-of-p2sh-p2wsh-address) address. `cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70` is the hash of a script that currently only the owner knows (until an output to that address has been spent). The `bc1...` representation is the [bech32 encoded](https://github.com/bitcoin/bips/blob/dd4467d12b811c3e5ee97f3eb5f3a73aa1ec4464/bip-0173.mediawiki) [BIP142 address](https://github.com/bitcoin/bips/blob/master/bip-0142.mediawiki#specification), which includes a checksum and a human readable currency identifier `bc`. It contains exactly the same information, i.e., a P2WSH script of the form `0 .


---

