Payments
Infernet 1.0.0
introduces a new payment system. This allows Infernet nodes to accept payments for their services, and
for consumers to pay for the subscriptions they create on-chain.
Here's an outline of the payment system:
Payment Setup
- The node operator creates an Infernet
Wallet
through infernet'sWalletFactory
contract. This wallet will be used to receive payments from consumers. - The node operator specifies which tokens they accept as payment. This is done through the
config.json
of their Infernet node. - A consuming user also creates an Infernet Wallet, which they will use to pay for their subscriptions.
Subscription Creation
-
Subscriptions are created via either a Normal Subscription or a Delegated Subscription. The payment parameters are specified as follows:
token
: Address of the token to be used for payment. Zero address means payment in the native token.amount
: The maximum amount to be paid.wallet
: The address from which the payment will be made.
-
The consumer will also have to approve their contract to spend the specified amount of tokens out of their wallet.
-
The graph below shows this flow for a normal subscription.
Subscription Detection
-
An Infernet node will be monitoring the blockchain for new subscriptions. When it sees a new subscription, it will check if the subscription has a payment attached to it.
-
If it does, it will check if the payment is valid. This can mean a few things:
- The payment is in a token that the node accepts.
- The payment meets the minimum required amount.
- The payment is made from a valid wallet.
-
If the payment is valid, the node will accept the subscription and forward it to its containers for computation.
-
The node will deliver the container's results to the
Coordinator
.
Payment Settlement
- The
Coordinator
contract collects the payment from the consumer's wallet and deduct the network fee. - The
Coordinator
contract ensures that the subscription does not require verification. - The
Coordinator
contract then transfers the payment to the node's wallet, and deliver the computation results to the consumer's contract.