How to determine which private key signed a transaction

0
7


Your question is based on a misconception. The Bitcoin protocol does not operate on addresses, or balances.

Transactions have outputs and inputs. Each outputs creates a “coin”, of a certain value, and with a certain condition under which it can be spent. Every input spends a coin – in its entirety – by referencing that coin explicitly, and proving it is allowed to spend it.

Those spending conditions are often represented for human consumption as addresses, but “address balance” is simply the sum of the values of all coins with a spending condition matching that address, which have not yet been spent.

So how do wallets, and the protocol, determine whether a transaction is valid? Not by looking at its balance, but by checking that the coin referenced in the input hasn’t been spent yet, that the transaction contains valid signature(s) for it, and that the sum of the values of the inputs is at least as much as the value of the outputs being created.

What block explorer websites show you is deceiving. They try to represent transactions as reducing the balance of some addresses, and incrementing the balance of others. This isn’t what’s actually happens. In reality, transactions just melt down and reforge coins.



Source link

Leave a reply