Introduces Agreement properties standard to allow negotiating incremental payments during task execution.
The current payments scheme allows only to pay for tasks, after all computations are finished and Invoice is sent to the Requestor.
In case of long-running tasks or services, Provider would expect that they will be paid during the activity’s execution, because they don’t want to wait for the task to finish before they have a chance to receive any payment for it.
Setting payment_due_date
in a Debit Note will cause the yagna payment module on the requestor’s end to automatically pay the Debit Note, after it is accepted.
Also, because of the current limitations of the yagna daemon’s payment driver, the payment will be issued immediately after such acceptance.
This specification describes the semantics of the required payment parameters and how Requestor and Provider should agree on them.
Name | Type | Description |
---|---|---|
golem.com.scheme.payu.debit-note.interval-sec? |
Number (uint32) [Negotiable] | Minimum time (in seconds) between subsequent Debit Notes related to a single Activity. The Provider must not issue the next Debit Note before the interval period. The Requestor ignores Debit Notes issued before interval elapses and terminates the offending agreement. |
golem.com.scheme.payu.payment-timeout-sec? |
Number (uint32) [Negotiable] | Maximum time to receive payment for any Debit Note. This time is counted from Debit Note’s issue date. At the same time, this is the minimum interval (in seconds) between two subsequent payable Debit Notes (Debit Notes with payment_due_date property set) related to a single Activity. The Provider must not issue a next payable Debit Note before this interval elapses. The Requestor ignores any offending Debit Notes and terminates the agreement. |
golem.com.scheme.payu.debit-note.interval-sec?
, they are allowed to break the Agreement stating (in TerminateAgreement) that the Reason for termination is Provider’s perceived misconduct. They should set the golem.requestor.code
field in Reason structure to TooManyDebitNotes
.payment_due_date
attribute set to a non-empty value) to the requestor.
payment_due_date
set will be paid immediately regardless of the actual value of that field. Therefore, the Provider is not allowed to send such payable Debit Notes sooner than the time specified in the agreed golem.com.scheme.payu.payment-timeout-sec?
property elapses since the last payable Debit Note - or - since the start of the activity if it’s the first payable Debit Note.golem.com.scheme.payu.payment-timeout-sec?
, they are allowed to break the Agreement, stating Provider’s misconduct as the termination reason Reason. In this case, the golem.requestor.code
field in the Reason structure should be set to TooManyPayableDebitNotes
.DebitNoteSettledEvent
timestamp to know, if Debit Note was paid in time.
golem.provider.code
field in Reason structure to DebitNoteNotPaid
.golem.com.scheme.payu.interval_sec
- Replaced by negotiable golem.com.scheme.payu.debit-note.interval-sec?
. Provider
using mid-agreement payments specification can’t set interval_sec
property.
Note: We encourage using golem.com.scheme.payu.debit-note.interval-sec?
property in new implementations,
even when parties don’t need mid-agreement payments.
Following modifications need to be applied to components in Golem suite:
yagna
payment_due_date
logic is implemented to ensure accepted DebitNotes are paid in timeya-provider
golem.com.scheme.payu.debit-note.interval-sec?
and golem.com.scheme.payu.payment-timeout-sec?
propertiesgolem.com.scheme.payu.debit-note.interval-sec?
to ensure DebitNotes are generated based on negotiated time intervalgolem.com.scheme.payu.payment-timeout-sec?
to validate payments are made according to negotiated termsyapapi
/yajsapi
golem.com.scheme.payu.debit-note.interval-sec?
and golem.com.scheme.payu.payment-timeout-sec?
propertiesDebit Note creation time can’t serve as a base for payment timeout, because both Provider and Requestor can lie about timestamps of this artifact. Moreover, Provider first issues Debit Note and then sends it to Requestor.
We considered malicious Provider, that tries to break the Agreement, not from his fault, by waiting with sending Debit Note, and stealing this way time required for making transaction on blockchain. The conclusion was, that we need absolute timestamp for computing payment timeout, which both parties can agree on.
golem.com.scheme.payu.interval_sec
This property was used by Provider for declaring the interval between Debit Notes. Since more Debit Notes means more transactions, it is crucial for Requestor to negotiate higher intervals. On the other side Provider wants to be paid as often as possible. That’s why the choice of this value can’t be left in Provider’s hands and these 2 parties have to negotiate it.
payment_due_date
set.golem.com.scheme.payu.interval_sec
property.Problem:
If Requestors filtered Offers by golem.com.scheme.payu.interval_sec
, they might be incompatible now,
if no value isn’t handled properly.
TODO:
N/A
Provider can DDoS a Requestor by sending Debit Notes too often, incurring the processing overhead on them. By making the Debit Note interval negotiable, we can avoid this problem, because the Requestor is allowed to break the Agreement, if the Provider sends to many Debit Notes.
No other security issues are known.
Copyright and related rights waived via CC0.