Getting Started
IntroductionVision and MissionFor Users
Nodle IoTNodle AppNodle ClientNodle on zkSync EraNodle PortalNODL TokenNFT Minting ToolNodle ExplorerParticipateFor Developers
SubQuery IndexerNodle APIsNodle ParachainParachain ModulesNodle SDKNodle Android SDKNodle iOS SDKSmart MissionsMore Info
AppendixGlossarySponsoring Transactions
Introduction
Developers creating user-friendly hybrid apps and dApps on the Nodle Network have a choice: they can cover transaction costs or set aside funds for specific user actions. In practice, this means they can elect to pay all or a portion of their user’s transaction fees on the Nodle Chain. This makes it easy for users to use decentralized blockchains and enjoy the benefits, like having a public proof of their participation. It also saves them from dealing with complicated blockchain things like managing coins and fees. The ability to create a Nodle application without exposing their users to complex crypto concepts is the basis on which the sponsorship feature is developed. This feature also supports Web3 principles of decentralization and user transparency.
What is Sponsorship?
An individual creates a virtual fund reserve (called a pot) on the Nodle chain and allocates users to this digital pot. They also control how much the users can spend on the Nodle Network by setting limits. The individual creating the fund is called the “sponsor” as they are willing to put up the money to fund the transactions of the users they registered for their pot. These users need not have any wallet money of their own. The money comes from the sponsor who must actually have funds in their wallet before they can sponsor users.
Key Features and Advantages
Important features of the sponsorship pallet include:
- Accessibility: Any individual should be able to create a virtual fund (aka “pot”) to cover specific transactions for a set of registered users, and no special permissions are required for this. Note that this pot is just a representation of usage limits and it doesn’t get locked or reserved. Thus, it remains liquid at all times. However, the transaction will fail if there are no actual funds in the sponsor’s wallet
- Batch registration: Sponsors can register users individually or in batches, offering flexibility and ease of use.
- Robust user management: User accounts need not exist in the system or they don’t need funds to get started, minimizing barriers to entry. Sponsors can remove inactive users, ensuring that resources are allocated efficiently.
- Fund control: Sponsors maintain control over the funds they provide, ensuring that they are used as intended. Reserve limits for pots or users can be used for transactions that require reservations or deposits.
- Liquidity-friendly: Sponsors aren't required to hold the entire sponsorship amount in their wallets, promoting liquidity.
- Decentralization: Users' actions through the sponsorship pallet remain attributed to themselves, ensuring a decentralized user experience.
- Transaction control: Sponsors can specify the types of transactions they support, allowing for a tailored user experience. For example, NFTMinting, or AnySafe (which means safe transactions that are compliant with the sponsorship type, unlike the ones not controlled by the sponsorship).
- Proxy mechanism: An internal proxy mechanism protects sponsors' wallets and ensures that the borrowed funds return to the sponsor.
Advantages of Sponsoring Transactions
This feature:
- Significantly lower barriers to entry for enterprise and Web3 customers who want to use the Nodle Network
- Doesn’t require detailed understanding of crypto concepts for the end user
- Helps anyone to sponsor anyone as they see fit without any special permissions
- Maintains high security by rejecting invalid transactions and preventing fund leaks
Workflow
Our solution is based on a system called Free Signed Transactions. In this method, sponsors register user accounts they're willing to sponsor. Each user gets their unique proxy account created in a "pot," and they can have different proxy accounts in different pots.
If users aren't registered, they can't create NFTs or use other applications. Each user account has set limits on how much they can spend and the transaction fees they can incur, preventing any misuse. Once their accounts are registered, these users can connect directly to the blockchain, ensuring security and avoiding censorship.
A validity check is built in to catch invalid transactions early, like actions from unregistered users or users who've used up their sponsorship quota, before any fees are incurred.
What types of funds can be sponsored?
A sponsor can define the following types of funds to be allocated to each user:
- Transaction fee: Fees for all transactions done on the chain
- Reservation fee: Tokens reserved for creating NFTs or other apps on the chain, which require a deposit.
In both cases, the limits defined cannot be exceeded by users.
What types of transactions can be sponsored?
Sponsors can decide on the types or categories of transactions they permit. This can be broad, like AnySafe
, or more specific, such as NFTs
, or even narrower, like NFTMinting
. A "safe" transaction means it doesn't go beyond the allowed sponsorship parameters. For instance, if a user is allowed to make NFT and Utility calls but not Balances transactions, they could potentially conceal a Balances "transfer" within a Utility call.
The transaction categories that are currently supported include:
AnySafe
: For any safe transaction on the Nodle NetworkUnique
: For creating or minting NFTs If required, more transaction categories can be added by creating pull requests on the Nodle chain repositories on GitHub.
Create a Pot with Funds
Sponsors can create pots with funds and register users to use the funds in the pot. Here, the pot is virtual and only represents usage limits. These funds remain liquid and usable at all times. However, the transactions may fail if a sponsor’s wallet doesn’t have the actual funds.
To create a pot with funds, follow these steps.
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet.
- Navigate to the Developer tab. Click Extrinsics from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the submit the following extrinsic menu. The createPot option is displayed at the top.
- Enter a unique pot ID. The default is 0. Enter whole numbers only.
- Select the sponsorship type. For example, AnySafe for any safe transactions on the chain, Unique for NFTs. Some categories can be further broken down into specific ones, such as NFTMinting.
- Set the limit for the fee quota. Set the limit for the fee quota as shown in the above image. This fee quota is for any transaction fee incurred. Enter a big number (preferably, greater than or equal to 11 digits) in integers, no fractions.
- Next, set the reserve quota. Again enter a whole number without fractions or decimals (11 digits or more). This amount is used for any reserves or deposits (such as the ones required by NFTs).
- Click Submit Transaction. Enter your account password and authorize the transaction as shown below.
- Click Sign and Submit. Once the transaction is successful, the pot is created with the defined reservation and fee limits.
Register Users for a Pot
Once the sponsors create a pot with the quotas, they can go ahead and register users for the pot. So, only these registered users will be able to use the sponsor’s reserve funds for carrying out their transactions on the chain. Any non-registered user will not be able to use the sponsorship quota. Note that these users need not have any funds of their own as they are going to borrow from the sponsor’s funds.
To register these users, follow these steps.
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet as shown above.
- Navigate to the Developer tab. Click Extrinsics from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the submit the following extrinsic menu.
- Then, select the registerUsers function. Select registerUsers from the drop-down menu. Under the pot section, enter the pot ID under which you want to register users. By default, it is 0.
- Click Add item. And, click inside the AccountId box to select a user account for registration. Alternatively, if you know the account IDs, enter those in the box.
- Enter the common fee quota and reserve quota limits. Enter whole numbers only.
- Add other users as required. To add multiple users for the selected pot, repeat steps 5-6.
- Click Submit Transaction. Authorize the transaction as shown below by entering your account password.
- Click Sign and Submit. Your users are now registered and ready for carrying out transactions on the chain.
Update Pot Limits
Only sponsors can change the spending limits for their funds and users, but they can't go below the amount their users have already spent (let's call it X). So if a user has used up X amount of their limit (L) for transaction fees, the sponsor can't set the limit lower than X. At that point, the user will have L - X left to spend. The sponsor can reduce the limit all the way down to X, in which case the user won't have any funds left. This same rule applies to borrowed funds given to the user for the reserve.
To update the pot limits, follow these steps.
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet as shown above.
- Navigate to the Developer tab. Click Extrinsics from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the submit the following extrinsic menu.
- Then, select the updatePotLimits function. Select updatePotLimits from the drop-down menu. The pot limits are applicable for the entire pot and across users of the pot.
- Enter the pot ID. Under the pot section, enter the pot ID for which you want to update or modify the limits. By default, it is 0.
- Update the fee limit. Enter the new value under newFeeQuota. This is for modifying the transaction fee limit.
- Update the reserve quota limit. Enter the new value under newReserveQuota. This is for modifying the reserve quota fee limit.
- Click Submit Transaction. Authorize the transaction by entering your password.
- Click Sign and Submit. The fund limits get updated if the submission is successful.
Update User Limits
Sponsors can modify the reservation and fee limits for a list of users at once. User limits are those a sponsor can set for each user of the pot. This means the user cannot exceed the limit set here even though the pot limits may be higher.
To update the user limits, follow these steps.
- Step 1: Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet.
- Navigate to the Developer tab. Click Extrinsics from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the submit the following extrinsic menu.
- Then, select the updateUsersLimits function. Select updateUsersLimits from the drop-down menu. These limits will be applicable across users of the selected pot.
- Enter the pot ID. Under the pot section, enter the pot ID. By default, it is 0.
- Click Add item. Click inside the AccountId box to select a user account.
- Select multiple users for batch update. Repeat steps 5-6 to select multiple user accounts. This way, you can set common reservation and fee limits for multiple users of the same selected pot.
- [Or] Select individual users. Alternatively, to set different fee and reservation limits for each user account, submit separate transactions for each account by repeating steps 1-6. Continue setting the limits as given in steps 9-10 for each user account.
- Update fee limits. To update or modify the fee limit, enter the new value under newFeeQuota.
- Update reserve quota limits. To update or modify the reserve quota, enter the new value under newReserveQuota.
- Click Submit Transaction. Authorize the transaction by entering your password.
- Click Sign and Submit. The fund limits get updated if the submission is successful.
Remove Users
Sponsors can remove users who have fulfilled all their obligations on the network. For instance, if a user has created an NFT collection, the funds set aside for that collection should stay reserved. Such a user cannot be removed until they delete the collection.
To remove users from a pot, follow these steps.
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet.
- Navigate to the Developer tab. Click Extrinsics from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the submit the following extrinsic menu.
- Then, select the removeUsers function. Select removeUsers from the drop-down menu. Under the pot section, enter the pot ID under which you want to delete users. By default, it is 0.
- Click Add item. Click inside the AccountId box to select a user account for deletion. Alternatively, if you know the account IDs, enter those in the box.
- Click Submit Transaction. Authorize the transaction by entering your password.
- Click Sign and Submit. Once the transaction is successful, the users are removed from the selected pot.
Repeat this step to select multiple users for batch deletion.
Delete a Pot
Sponsors can delete pots they have created. However, keep in mind that the pot should not have any users associated with it. If there are, remove users from the pot before deleting the pot.
To delete a pot, follow these steps.
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet.
- Navigate to the Developer tab. Click Extrinsics from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the submit the following extrinsic menu.
- Then, select the removePot function. Select removePot from the drop-down menu.
- Enter the pot ID. Under the pot section, enter the pot ID which you want to delete. By default, it is 0.
- Click Submit Transaction. Authorize the transaction by entering your password.
- Click Sign and Submit. If the transaction is successful, the pot is deleted.
Conducting Transactions Using Sponsorship Pallet
You can use your own wallet (even if you don’t have enough tokens in it) to interact with the blockchain, and there's no need for a middleman. How is this possible? Through the concept of sponsorship.
Sponsors provide the necessary tokens and decide what transactions they want to support for you, as a user. They also register users so that they can interact directly with the blockchain. You, as a user, can use these tokens to perform the transactions that the sponsor has specified.
However, they can't control what you do. You have control over your actions, which is important for apps relying on blockchain proof, like owning digital assets. Even if a sponsor stops, there's always a record linking proxy accounts to users, who can prove ownership by showing they control their wallet.
What actions can you perform using the sponsorship feature?
The sponsorship feature uses a function called “sponsorFor()” to enable users to interact with the network. This function draws the tokens from the sponsor’s fund to run transactions. Through this, you can perform any safe transaction that the sponsor has specified for you.
However, you cannot execute transactions that allow funds to leak from your proxy account. For example, you cannot transfer funds to other accounts even if the sponsorship type enables “balances” transactions.
Executing Transactions on the Network
When you execute the sponsorFor()
function, the:
- Transaction is sent to the chain
- Fee is deducted from the sponsor's account
- User's proxy account is set as the source of the transaction before the transaction actually happens
Ensure you are a registered user of the selected pot before using the sponsor’s funds and also make sure you are using the funds for the specified transaction type only.
You can execute your transactions on the network by following these steps:
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet as shown above.
- Navigate to the Developer tab. Click Extrinsics from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the submit the following extrinsic menu.
- Then, select users. Select
sponsorFor()
function from the drop-down menu. - Select the pot. Enter the pot ID. By default, it is 0. This is the pot that the sponsor signed you up for.
- Next, select the required function. From the system menu, select the function you want. For example, remark from the system pallet.
- Enter the remark as required. Enter the remark you want for the transaction in the box below (highlighted in red).
- Click Submit Transaction. Authorize the transaction by entering your account password.
- Click Sign and Submit. Once done, the transaction is successfully submitted.
What happens when a transaction is successful?
The pallet emits the event "Sponsored {paid, repaid}" when things go well:
"Paid" is the money given by the sponsor to the user's proxy account initially
- "Paid" may be less if the user can use their own money in the proxy account or if there's a limit in their account
- "Paid" is also limited by the remaining reserve quota for the account
"Repaid" is the money the user pays back to the sponsor after the action is successful
- “Repaid" can be more than "paid" when the user’s proxy account allows a bigger repayment for their current loan.
Here is a screenshot of a successful transaction.
Determining Users of a Pot
As a user of the sponsorship funds, ensure you are registered for the selected pot before you start using these funds. You can also check the transaction and reserve quota limits pertaining to your account by using this feature.
To check the users registered for the pot, follow these steps:
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet
- Navigate to the Developer tab. Click Chain State from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the selected state query menu.
- Then, select users. Select the
user()
function from the drop-down menu. - Enter the pot ID. Enter the pot ID in the box below. By default, it is 0. This is the pot that the sponsor signed you up for.
- Check for the desired account. Specify the account you wish to check and select the “Include option”.
- Click the + button (on the right of your screen) to view the details of the pot. Details of the account including the fund limits are displayed in the section below.
To check for all the registered users of the selected pot, disable the “Include option” and then click the + button.
Determining the Pot Limits
You can check the fund limits of your pot and the type of transactions you can perform before using the funds.
To check the fund details of your pot, follow these steps:
- Go to https://nodleprotocol.io/#/accounts. Select Nodle Mainnet.
- Navigate to the Developer tab. Click Chain State from the pull-down menu.
- Select the sponsorship pallet. Select sponsorship from the selected state query menu.
- Then, select the pot. Select the
pot()
function from the drop-down menu. - Enter the pot ID. Enter the pot ID in the box below. By default, it is 0. This is the pot that the sponsor signed you up for.
- Select the “Include option”. Details of the pot including the fund limits and the transaction type are displayed.
← Previous
Next →
On this page
- Sponsoring Transactions
- Introduction
- Key Features and Advantages
- Workflow
- Create a Pot with Funds
- Register Users for a Pot
- Update Pot Limits
- Update User Limits
- Remove Users
- Delete a Pot
- Conducting Transactions Using Sponsorship Pallet
- What actions can you perform using the sponsorship feature?
- Executing Transactions on the Network
- What happens when a transaction is successful?
- Determining Users of a Pot
- Determining the Pot Limits