Intmax: Trustless and near zero gas cost token-transfer/payment system

We adopted the following method.

let’s assume the values are under uint256-2 and the maximum number 2^256-1 = uint256(-1)

To merge

  1. check the value for the key= tx-hash is 0 (not uint256(-1)) in the User Asset Storage (SMT)
  2. update the value for the key=tx-hash

To purge

  1. check the value for the key= tx-hash is not uint256(-1) in the User Asset Storage (SMT)
  2. if a new purge makes the balance 0 from a number(>0), the balance value will be set to uint256(-1)

We cloud simply introduce the SMT consisting of hashes of merged state-diff to the client-side tree, but it made more constraints.

Only the thing we should do is to distinguish the initial value of 0 and a used (reduced) value of 0.

1 Like