1

when i send a transaction to a bitcoin node how can the node know that my address exists and where in the chain my address is? does it do a verification? how does it know that I have the funds knowing that it does not index the addresses

1
  • There is no concept known as "wallet" on the blockchain. Each address stands on its own, nothing associates them with each other except transaction history. The fact that a given set of addresses are grouped into an HD account-wallet is a secret known only to the wallet-client, except what can be deduced via transaction history.
    – HansBKK
    2 days ago

1 Answer 1

0

Addresses

Transactions don't actually contain addresses.

A Bitcoin address is really more like an invoice reference number created by the intended recipient of the money.

The address value allows the senders wallet to construct a transaction that contains an output for that recipient. The output has a bitcoin script, a small program written in Bitcoin scripting language. This script is sometimes called the locking script and it ensures only the recipient can later spend that money. The script is created from the number we call an address.

So other nodes don't ever see actual addresses and don't need to check output addresses. They don't really care about outputs although they do keep a list of unspent outputs (UTXOs). It is only some time later (if ever) when that output is reference as an input to a later transaction that nodes will check the unlocking script produces the right values to satisfy the locking script.

Funds

The Bitcoin network doesn't keep track of your total funds or balance. Bitcoin nodes neither know or care about how much money you have. They only care about whether the coins being spent are genuine. Just like the owner of a coffee shop doesn't need to know your bank balance they just check the coins and banknotes you gave them look and feel real.

Bitcoin nodes check that the transaction inputs are not already spent. Each input should be a reference to a UTXO from some prior transaction.

2
  • So if I want to send BTC, I need the UTXO of the latest transaction + pubk/privk? I can't just know my pubk/private key to send May 2 at 18:11
  • You can't send BTC you don't have. To create a transaction you need to know the private-key corresponding to a UTXO created in a transaction sometime in the past. You can then use that UTXO as an input in your new transaction. Your wallet creates an unlocking script for the input in the new transaction that provides the right values for the locking script of the UTXO in the earlier transaction. This very loosely corresponds to you only being able to spend coins you have possession of May 2 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.