Skip to content

Chess: allow users to end the game amicably #388

@ClemensLey

Description

@ClemensLey

The flow could be:

  • When the game is created in the ChessContract constructor we add another sub-object of class TxWrapper (see the swap packet) that does not contain a txHex yet. This object is owned by both players and the operator
  • All players and the operator subscribe to the TxWrapper object using this: https://docs.bitcoincomputer.io/lib/computer/subscribe/
  • When the game is over winner creates a partially signed transaction (like the one that is sent to the server now)
  • The winner calls the setTx function on the TxWrapper object with the partially signed transaction.
  • When the other player receives a notification from the subscription on the TxWrapper object (that is in the onMessage function of the subscribe function, they check if they should sign the transaction and if so sign and broadcast it.

The next step will be to implement the operator on the client which will be very similar.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions