Bitcoin Forum
April 27, 2024, 07:44:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does the blockchain know the public address?  (Read 120 times)
whanau (OP)
Member
**
Offline Offline

Activity: 114
Merit: 28


View Profile
December 29, 2023, 07:24:01 PM
 #1

Alice wants to send Bob some Bitcoin so he creates an address 1BOB.... which he sends to Alice.
Alice sends the Bitcoin and the transaction proceeds.

My understanding is that 1BOB.... is a more readable version of the X,Y co ordinates of the public key obtained after a 1 way hash function. (ripemd160)
So given that the co ordinates X,Y have been hashed, How does the blockchain work out X,Y (the full public key) in order to create the transaction ?

I am obviously missing something
1714203846
Hero Member
*
Offline Offline

Posts: 1714203846

View Profile Personal Message (Offline)

Ignore
1714203846
Reply with quote  #2

1714203846
Report to moderator
1714203846
Hero Member
*
Offline Offline

Posts: 1714203846

View Profile Personal Message (Offline)

Ignore
1714203846
Reply with quote  #2

1714203846
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714203846
Hero Member
*
Offline Offline

Posts: 1714203846

View Profile Personal Message (Offline)

Ignore
1714203846
Reply with quote  #2

1714203846
Report to moderator
1714203846
Hero Member
*
Offline Offline

Posts: 1714203846

View Profile Personal Message (Offline)

Ignore
1714203846
Reply with quote  #2

1714203846
Report to moderator
1714203846
Hero Member
*
Offline Offline

Posts: 1714203846

View Profile Personal Message (Offline)

Ignore
1714203846
Reply with quote  #2

1714203846
Report to moderator
garlonicon
Hero Member
*****
Offline Offline

Activity: 800
Merit: 1932


View Profile
December 29, 2023, 09:13:08 PM
Merited by vapourminer (2), ABCbits (2), whanau (1)
 #2

Quote
How does the blockchain work out X,Y (the full public key) in order to create the transaction ?
It simply does not. It is only checked, when the owner reveals that public key explicitly. Which means, you can send your coins, even to some invalid hash of some public key, and then it will never be moved.

And yes, it happened in the past, for example those coins are unspendable forever: https://bitcointalk.org/index.php?topic=50206.0
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10504



View Profile
December 30, 2023, 04:39:09 AM
Merited by NeuroticFish (4), ABCbits (4), Charles-Tim (1), whanau (1)
 #3

Stop thinking in terms of addresses and public keys. In bitcoin we are "locking" up coins inside "smart contracts" and to spend those coins you need to provide an "unlocking mechanism/script" to be able to spend them.

It could be described as locked mailboxes. If you know the address of the mailbox you can go to it and insert the mail into its opening slot. But only the owner who has the key can open the lid and take the contents out.

In Bitcoin the "key" that unlocks your coins to allow you to spend them or the "unlocking mechanism" is a script in the Bitcoin's smart contract protocol.

For example take this very simple example: 3MaB7QVq3k4pQx3BhsvEADgzQonLSBwMdj
Coins sent to this address can be spent by providing a very simple unlocking script that only contains OP_TRUE.
<0x51> + OP_HASH160 da1745e9b549bd0bfa1a569971c77eba30cd5a4b OP_EQUAL
As you can see there is no public key here.

It's the same with everything else like when you send coins to a P2PKH address you are locking coins inside a OP_DUP OP_HASH160 <push20> OP_EQUALVERIFY OP_CHECKSIG smart contract. To unlock this the owner has to provide a script like <push72><push33> containing ECDSA signature and public key.

To verify the validity of these scripts, the nodes evaluate and execute these scripts in a FORTH like script language and if it ends up with a success, the transaction is valid and coins can be spent.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ABCbits
Legendary
*
Offline Offline

Activity: 2856
Merit: 7407


Crypto Swap Exchange


View Profile
December 30, 2023, 09:34:54 AM
 #4

My understanding is that 1BOB.... is a more readable version of the X,Y co ordinates of the public key obtained after a 1 way hash function. (ripemd160)
So given that the co ordinates X,Y have been hashed, How does the blockchain work out X,Y (the full public key) in order to create the transaction ?

I am obviously missing something

The wallet you use contain data which map between private key, public key, address and other related information. So when Bob want to spend his Bitcoin, his wallet create transaction with associated private key and create signature where you can extract associated public key.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
whanau (OP)
Member
**
Offline Offline

Activity: 114
Merit: 28


View Profile
December 30, 2023, 04:52:21 PM
 #5

Thank you all for your very detailed replies.
Now I understand.  Grin
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!