why aren't transactions on the blockchain stored like "from, to, amount"?

1

Wouldn't it save lots of block space and reduce transaction fees? It seems to me the current method wastes lots of space. I wasn't able to find a technical reason for the current method

user1781498

Posted 2017-11-27T01:50:34.120

Reputation: 13

Question was closed 2017-11-27T05:04:26.050

Bitcoin transactions basically are just "from, to, amount" - "from" are the inputs, "to, amount" are the outputs. What specific difference are you suggesting?MeshCollider 2017-11-27T04:56:34.513

Answers

1

On some blockchains, they are. They just don't work that way on the bitcoin blockchain. There are advantages to the way bitcoin does it. What if you want to send bitcoins to more than one destination or from more than one source?

Also, bitcoin's scheme is much simpler. Either a particular transaction output exists and is unspent or it isn't. A balance is the end result of a very large number of transactions and much more complex to verify.

David Schwartz

Posted 2017-11-27T01:50:34.120

Reputation: 46 931

Not only that, an accounts based system is vulnerable to transaction replay. Suppose you were to send me money in a transaction. What prevents me from waiting until your balance is high enough and rebroadcasting that transaction?Andrew Chow 2017-11-27T02:39:27.370

@AndrewChow That's not particularly difficult to solve. Ripple does it by requiring that transactions include a sequence number that must match the account's sequence number. During the transaction execution, the account's sequence number is incremented, forever invalidating the transaction. (Ripple also supports binding the transaction to a "ticket" that can only exist once and which is destroyed when the transaction succeeds.) If an account can have a balance, it can just as easily have a sequence number.David Schwartz 2017-11-27T02:40:46.923

You have to store the sequence numbers forever though.Anonymous 2017-11-27T06:43:14.420