Double Spending

When proposal block is received at a replica, is the checking for double spending transaction done at the bytecode verifier? I am not able to find the specific point where this check is done.

Hi @dragonboy,

I think the answer to your question depends on what you mean by double spending. In a UTXO-based system like Bitcoin where coins have an “identity”, double spending can mean sending a coin with the same identity (i.e., the same UTXO) to two different users. Diem is an account-based system, where coins do not have identities, so this problem cannot happen. However, here are a few problems similar to double spending and where Diem prevents them:

  • “Overdrafting” a coin: this is prevented here here
  • Copying a coin, moving the same coin into two different callee procedures: these are prevented by the resource safety analysis in the bytecode verifier

@sam Thank you for your reply. It answers my question.