What are the drivers behind the decision to adopt an account model (as opposed to an utxo one) to describe transactions in Tezos ?


First off, utxos and accounts aren't that different. You can look at the pair (account, counter) as almost equivalent to a utxo.

The main reason has to do with concurrent access to smart contracts. In most cases, two transactions to the same smart-contract will commute (or almost commute) and therefore the senders do not need to know what other transactions are affecting this particular contract in the same block.

For instance, imagine a contract selling plane tickets. Until the plane is full, transactions to that contract will commute. My buying a plane ticket and your buying a plane ticket can happen at the same time.

If we try and extend the UTXO model to smart-contracts, as soon as I buy my plane ticket, the contract would in a sense be destroyed, and a similar contract selling one fewer ticket would be recreated with a different handle. We would not both be able to access that contract in the same block.

If this behavior is desired, it can be emulated by an account based smart-contract system. For instance, a contract could require that every transaction to it must pass a hash of its current storage. However, the reverse is not true.

Therefore, the account based system is more expressive.

  • 1
    Thanks a lot it is very clear! I remember you were also talking about the flipside of this when it comes to mempool management i believe where UTXO make it easier for a miner to choose any subset of tx to include because the final chain state is indifferent to the order of those UTXO being applied whereas in an account model the order of tx hitting a contract may impact its final state. But i forgot what constraint it creates on the mempool management itself. – Ezy Feb 1 '19 at 11:54
  • 2
    I have since realized that really matters is that you keep utxo like properties for the payment of transaction fees. If you do that, you get all the benefits of mempool management and quasi-commutativity of operations. – Arthur B Feb 1 '19 at 12:17
  • 1
    tx. I would like to understand your last remark better. Worth a separate question ? – Ezy Feb 1 '19 at 12:23
  • 2
    Happy to answer a separate question, so long as it's clearly stated :) – Arthur B Feb 1 '19 at 13:02
  • 1

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.