golem-architecture

Abstract

Introduces Agreement properties standard to allow negotiating incremental payments during task execution.

Motivation

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.

Specification

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.

New properties

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.

Deprecation

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.

Impact analysis

Following modifications need to be applied to components in Golem suite:

Rationale

Debit Note interval and payment timeout relative to Agreement approve timestamp

Debit 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.

Deprecation of 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.

Backwards Compatibility

Problem: If Requestors filtered Offers by golem.com.scheme.payu.interval_sec, they might be incompatible now, if no value isn’t handled properly.

Test Cases

TODO:

Reference Implementation

N/A

Security Considerations

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.