Suhas
Suhas

Reputation: 8448

What is the best way for a counter-party to update one of the input states to a transaction?

I have a business requirement where a counter-party needs to update one of the input states to the transaction before the transaction can be committed to the ledger.

One way I was thinking this could be achieved was to make the state changes on the counter-party side when it responds to the collect signature call. I have two questions

  1. Are state changes allowed during collect signature flow?
  2. Is this the best way to achieve this or there are better alternatives?

Upvotes: 0

Views: 40

Answers (1)

Cais Manai
Cais Manai

Reputation: 966

Several things you need to consider

  • Input states to a transaction are unspent output states from previous transactions (UTXO)
  • To update an output state, you would need to add it as an input in a new transaction and create an updated version of this state and add as an output to the transaction
  • If you require the counter-party to make changes to this state, you could use a flow to send them the state, they make the changes and then sent it back for you to add to the transaction. But note, that this would be added as an output
  • State changes are not allowed during collect signature flow as the transaction builder will have already been signed by the initiator making it immutable

Upvotes: 1

Related Questions