Bitcoin Forum
July 22, 2024, 05:44:20 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 127 times)
whanau (OP)
Member
**
Offline Offline

Activity: 118
Merit: 31


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
garlonicon
Hero Member
*****
Offline Offline

Activity: 828
Merit: 2011


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: 3514
Merit: 10713



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.

█████████████████████████
████████▀▀████▀▀█▀▀██████
█████▀████▄▄▄▄████████
███▀███▄███████████████
██▀█████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██▄███████████████▀▀▄▄███
███▄███▀████████▀███▄████
█████▄████▀▀▀▀████▄██████
████████▄▄████▄▄█████████
█████████████████████████
 
 BitList 
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
REAL-TIME DATA TRACKING
CURATED BY THE COMMUNITY

.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
 
  List #kycfree Websites   
ABCbits
Legendary
*
Offline Offline

Activity: 2940
Merit: 7692


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: 118
Merit: 31


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!