git.delta.rocks / unique-network / refs/commits / dc6f0e24d331

difftreelog

source

doc/economic_model.md9.4 KiBsourcehistory
1# Economic Model23## Economy Goals45One of the goals of this specification is to find means to provide for network infrastructure (incentivisation of6validators) and development support for NFT Parachain. Transaction fees will be used as the main source of funds. Fees7will be distributed among network participants. The distribution of fees will depend on validator contribution to the8network (similarly to Polkadot network) and the chosen fee structure (model).910## Summary1112We are going to offer several fee models for our users. Some models will be implemented immediately, some will wait13until there is a demand.1415The fee models can be setup by Collection and by Smart Contract address. Every Collection or Smart Contract has a fee16model associated with it, which determines how transactions are paid. Network users can choose the fee model that better17suits their application. The fee model can be changed later as well.1819Initially we offer 4 models for consideration:2021-   User paid fees (conventional blockchain method)22-   Sponsored (same as above, but paid by sponsor)23-   Prepaid plan24-   Resource purchase2526## Token and Accounts2728Network Tokens are tracked via standard Balances module, which is included in NFT Parachain.2930User Account matches to user address in the network. Among other properties user Account has Balance, which will be used31later on.3233## Settings Economic Model3435The dedicated pallet calls allow updating the fee structure for the collection or smart contract.3637### SetCollectionSponsor3839#### Description4041Set the collection sponsor address. The sponsorship needs to be confirmed by sending a ConfirmSponsorship transaction42from that address. Also, the protection measures need to be in place so that sponsor account cannot be depleted by43malicious users. Allow listing is one of the measured. It can be enabled with SetPublicAccessMode method.4445##### List of transactions4647Transactions that can be sponsored:4849-   Transfer50-   Approve51-   TransferFrom52-   TransferWithData53-   TransferFromWithData54-   BurnItem5556##### Rate Limiting5758This is a design proposal, actual implementation may change.5960Features:6162-   Token transactions per day: The timestamp of last transaction performed on a token (NFT only) is associated with63    token ID in a dictionary. When a next transaction is run, the time is checked against this timestamp and, if less64    than allowed by rate limit, the fee is paid by caller account instead of the sponsor.65-   Address transactions per day: The timestamp of last transaction performed by an address (only if transaction is in66    the [list of affected transactions](#list-of-transactions)) is associated with caller address in a dictionary.67    Further, the logic is similar to limiting by token as above. If only one of the limits (by token or by address)68    indicates that fee should be paid by the user, the fee is paid by the user.69-   A pallet method (SetCollectionRateLimits) will be added to set these parameters and enable rate limiting.70-   One idea to consider is deposits that must be made by an address in order to become allow listed (instead of admin71    review).7273#### Permissions7475-   Collection Owner7677#### Parameters7879-   CollectionId: ID of the collection80-   Sponsor: Sponsor address81-   Fee Model ID: ID of selected economic model. Currently, only "Sponsored" mode is supported, which will be ID = 1.8283### ConfirmSponsorship8485#### Description8687Confirm sponsorship of a collection. This call is needed to protect sponsor address from malicious collection creators.8889#### Permissions9091-   Collection Sponsor only9293#### Parameters9495-   CollectionId: ID of the collection9697### RemoveCollectionSponsor9899#### Description100101Switch back to pay-per-own-transaction model.102103#### Permissions104105-   Collection owner106107#### Parameters108109-   collectionId: ID of the collection110111### ClaimContract112113#### Description114115Claim the contract ownership for the purpose of sponsoring. Once the contract is claimed, only the contract owner can116manage the contract sponsorship. Also, the contract may be claimed only once.117118#### Permissions119120-   Anyone121122#### Parameters123124-   ContractAddress: Address of the contract125-   Sponsor: Sponsor address126127### SetContractSponsor128129#### Description130131Set the contract sponsor address. The sponsorship needs to be confirmed by sending a ConfirmContractSponsorship132transaction from that address. The spam protection measures are similar to collection sponsorship.133134#### Permissions135136-   Contract Owner137138#### Parameters139140-   ContractAddress: Address of the contract141-   Sponsor: Sponsor address142-   Fee Model ID: ID of selected economic model. Currently, only "Sponsored" mode is supported, which will be ID = 1.143144### ConfirmContractSponsorship145146#### Description147148Confirm sponsorship of a contract. This call is needed to protect sponsor address from malicious sponsorship requests.149150#### Permissions151152-   Contract Sponsor only153154#### Parameters155156-   ContractAddress: Address of the contract157158### RemoveContractSponsor159160#### Description161162Switch back to pay-per-own-transaction model.163164#### Permissions165166-   Contract owner167168#### Parameters169170-   contractAddress: Address of the contract171172### SetPublicAccessMode173174#### Description175176Toggle between normal and allow list access for the methods with access for “Anyone”. If Allow List mode is enabled,177AddToAllowList and RemoveFromAllowList methods can be called to add to and remove addresses from the allow list.178179Allow list mode is the property of collection. If it is turned on, all public operations such as token transfers, for180example, which normally have “Anyone” permission, become allow listed, i.e. are only available to collection owner,181admins, and addresses from the allow list. Allow lists can be helpful for rate limiting of transfers when collection182sponsoring is enabled.183184#### Permissions185186-   Collection Owner187188#### Parameters189190-   CollectionID: ID of the Collection to set access mode for191-   Mode192    -   0 = Normal193    -   1 = Allow list194195### AddToAllowList196197#### Description198199Add an address to allow list.200201#### Permissions202203-   Collection Owner204-   Collection Admin205206#### Parameters207208-   CollectionID: ID of the Collection209-   Address210211### RemoveFromAllowList212213#### Description214215Remove an address from allow list.216217#### Permissions218219-   Collection Owner220-   Collection Admin221222#### Parameters223224-   CollectionID: ID of the Collection225-   Address226227### SetCollectionRateLimits228229#### Description230231Enable or disable rate limits for a collection232233#### Permissions234235-   Collection Owner236-   Collection Admin237238#### Parameters239240-   CollectionID: ID of the Collection241-   TokenInterval: Number of seconds allowed between sponsored token trasnsactions. 0 means there is no limit.242-   AddressInterval: Number of seconds allowed between sponsored address trasnsactions. 0 means there is no limit.243244## User Paid Fees245246This is conventional fee model, when every Account pais for the transactions they sign and send. Transaction fee will247gradually increase if the network load is higher to prevent denial of service. The same type of transaction (with the248same transaction weight) will result in higher fee if previous block's weight gets close to maximum block weight. The249ratio for multiplying fees will be determined empirically. The multiplication will take place until the blocks stop250overpopulating, but with certain saturation. If blocks underfill, i.e. block weight is under the certain threshold, then251the next block will have lower fees. The lowering will continue until blocks stop underpopulating, with some saturation.252253Each module call will have weight annotation that will determine the weight calculation for this call:254255-   CreateCollection: Fixed256-   ChangeCollectionOwner: Fixed257-   DestroyCollection: Linear of number of items (or owner addresses, depending on the collection type) multiplied by258    Collection Data Size259-   CreateItem: Linear of Collection Data Size260-   BurnItem: Linear of Collection Data Size261-   AddCollectionAdmin: Fixed262-   RemoveCollectionAdmin: Fixed263-   Transfers and approvals: Fixed264-   Transfers with data: Fixed + linear of data size265-   All other: Fixed266267This model is default and will be set for each collection until collection owner decides to change it to some other268model.269270### Fee Distribution271272The fees will be burned. Incentivization is done through network token inflation, which will be designed in tokenomics.273274## Sponsored275276The only difference from User Paid Fees model is that collection owner will be paying for their users. The collection277owner must have enough balance on his account in order to pay for user transactions.278279### Fee Distribution280281Same as in User Paid Fees.282283## Prepaid Plan284285Collection Owner makes regular payments to prepay for some planned network load, i.e. some fixed number of transactions,286created items, etc.287288### Fee Distribution289290Same as in User Paid Fees.291292## Resource Purchase293294Collection Owner purchases some fixed amount of network resource, which can be measured in number of users and their295monthly transactions, for example. This is a one time payment. If Collection Owner decides to switch to a different fee296model, the resources may be sold back to the system (with some commission).297298Received funds will be converted to DOTs and used in staking (nomination or validation), which will allow to receive the299income that will pay for infrastructure and development support.300301### Fee Distribution302303Fixed percentage of staking income is distributed between validators proportionally to their contribution to the304network. The rest is credited to the network owner.