v.2 by Stepan
2018-11-02 21:11

Paying parcel

Is an extension to the parcel structure allowing include additional payment field that will not be registered if the transaction will fail. The new parcel structure should be:

  • transaction payment (no change)
  • transaction itself (no change)
  • extra payment, now the part of the transaction

The trick is that the extra payment could be (or must be if it is easier) the same U block payment as the transaction payment.

So, the calling software creates 2 U payment blocks:

  • first (this is mandatory) is transaction payment, that will always be accepted, as it is now

  • second extra payment block for the same U that is accepted with the transaction inside it.

Technically it is done by adding second payment to the new items of payload transaction in the calling client software, but the node software should be adjusted to be able to accept the second payment while it is based on the potentially not registered state if the first payment.

The new logic is:

  • if the first payment fails, no further action is taking (no changes)

  • if the first payments is OK, the transaction is evaluated and the second payment should be the part of it

  • if the transaction including the second payment is OK, the transaction and the second payment are registered altogether.

  • if any of the latest fail, the whole transaction is not accepted, e.g. the second payment is not accepted too