grin-wallet icon indicating copy to clipboard operation
grin-wallet copied to clipboard

Define transaction states

Open lehnberg opened this issue 7 years ago • 2 comments

Creating an issue to track. Relevant chat in gitter/design.

  • [ ] What are the different states a transaction/slate can have?
  • [ ] What are the valid transitions between these states?

Current proposal

  1. Created: Slate was generated.
  2. Pending: Slate has been passed to the other party(ies), and you are awaiting a response.
  3. Returned: Slate was processed and returned to whoever you got it from, and you are now awaiting to see the transaction.
  4. Finalized: A valid tx was broadcasted to the blockchain.
  5. Unconfirmed: A tx is on the chain but not yet received enough confirmations.
  6. Confirmed: A tx was confirmed on the chain.
  7. Cancelled: Tx was manually canceled by a user.
  8. Expired: A transaction expired before being finalized. (For example if other party cancelled.)

Open problems / critique

  • Some of these states as they are described above are implicit, there's no certainty that they have transitioned. Returned for example is an assumption the wallet has to make in the case of file-based tx building. Similarly, currently a transacting party will not know whether the other party Cancelled, therefore the transaction can only be Expired on their end. This is not ideal.

  • @sesam writes: I'm also not fully sure, but I think 4. finalized now no longer means sent to chain, and we'd need a local wallet state 4.1. sent (stemmed), 4.2 sent (fluffed). Then 5. unconfirmed (publicly seen/in the wild). Under 6. confirmed we could also have a parenthesis (1 confirmation) up to 10 confirmations, then Confirmed (trusted final)

lehnberg avatar Dec 11 '18 10:12 lehnberg

The general case of an n-party transaction would require further division of states 2 & 3. I propose calling the Pending states: Committed1, Committed2, ... Committedn, and calling the Returned states: Signed1, Signed2, ... Signedn. (CommittedByi and SignedByi are more verbose alternatives). The slate after step 1, Creation, could sensibly be called Committed0, but we can also imagine the creator to immediately add their own commitments to create a Committed1. We could add a further state between Signedn and Finalized where the tx is fully formed (all n partial signatures having been combined), but not yet submitted to Dandelion.

tromp avatar Dec 11 '18 11:12 tromp

I think this issue is still relevant and should probably be moved to https://github.com/mimblewimble/grin-wallet repository.

quentinlesceller avatar Mar 26 '19 13:03 quentinlesceller