I generated a
SegWit address, I got the private keys, I went to Bitaddress to type the PK and get the details. I got
1LnhJTGJJLdaUhP34SMHGwDqkfjFGfAzPQ while the real one is
3BVNuVsxgXSgg4WyD1r6rZxXa11VBFQUkWEssentially, private keys are just a very big number. The different address types are then derived from this number in slightly different ways. ie. compressed, uncompressed, SegWit.
So, with the same private key: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn
Bitaddress.org gives us:
Address (Compressed): 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH
Public Key (compressed, 66 characters [0-9A-F]):
0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798While segwitaddress.org gives us:
Address: 3JvL6Ymt8MVWiCNHC7oWU6nLeHNJKLZGLN
Public Key:
0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798Redeem Script: 0014751e76e8199196d454941c45d1b3a323f1433bd6
Note how the two public keys are the same?
The result of this is that, as always, if you have the correct private key, you will be able to access coins
that were assigned to a specific address derived from that private key.
However, to answer your specific question of:
I want to know, If I ever give the first address to someone and he send me some bitcoin, will I be able to spend it from the second (the SegWit one)? Let's just assume that the first one is from Blockchain.info and the second is from Trezor.
The short answer is NO.
To demonstrate, let us use our private key from above: "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn"
As we've seen, this private key generates the addresses:
"Legacy" -
1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH"SegWit" -
3JvL6Ymt8MVWiCNHC7oWU6nLeHNJKLZGLNYou can see by looking at the address history... "1" has a bunch of transactions... "3" has nothing.
So, the coins sent to "1" are completely separated from any coins/transactions sent to "3" (and vice versa)... even though both have the same private key.