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

difftreelog

source

doc/economic_model.md9.2 KiBsourcehistory
1# Economic Model23## Economy Goals45One of the goals of this specification is to find means to provide for network infrastructure (incentivisation of validators) and development support for NFT Parachain. Transaction fees will be used as the main source of funds. Fees will be distributed among network participants. The distribution of fees will depend on validator contribution to the network (similarly to Polkadot network) and the chosen fee structure (model).67## Summary89We are going to offer several fee models for our users. Some models will be implemented immediately, some will wait until there is a demand. 1011The fee models can be setup by Collection and by Smart Contract address. Every Collection or Smart Contract has a fee model associated with it, which determines how transactions are paid. Network users can choose the fee model that better suits their application. The fee model can be changed later as well.1213Initially we offer 4 models for consideration:1415* User paid fees (conventional blockchain method)16* Sponsored (same as above, but paid by sponsor)17* Prepaid plan18* Resource purchase1920## Token and Accounts2122Network Tokens are tracked via standard Balances module, which is included in NFT Parachain.2324User Account matches to user address in the network. Among other properties user Account has Balance, which will be used later on.2526## Settings Economic Model2728The dedicated pallet calls allow updating the fee structure for the collection or smart contract.2930### SetCollectionSponsor3132#### Description3334Set the collection sponsor address. The sponsorship needs to be confirmed by sending a ConfirmSponsorship transaction from that address. Also, the protection measures need to be in place so that sponsor account cannot be depleted by malicious users. White listing is one of the measured. It can be enabled with SetPublicAccessMode method.3536##### List of transactions37Transactions that can be sponsored:38* Transfer39* Approve40* TransferFrom41* TransferWithData42* TransferFromWithData43* BurnItem4445##### Rate Limiting4647This is a design proposal, actual implementation may change.4849Features:50* Token transactions per day: The timestamp of last transaction performed on a token (NFT only) is associated with token ID in a dictionary. When a next transaction is run, the time is checked against this timestamp and, if less than allowed by rate limit, the fee is paid by caller account instead of the sponsor.51* Address transactions per day: The timestamp of last transaction performed by an address (only if transaction is in the [list of affected transactions](#list-of-transactions)) is associated with caller address in a dictionary. Further, the logic is similar to limiting by token as above. If only one of the limits (by token or by address) indicates that fee should be paid by the user, the fee is paid by the user.52* A pallet method (SetCollectionRateLimits) will be added to set these parameters and enable rate limiting.53* One idea to consider is deposits that must be made by an address in order to become white listed (instead of admin review).5455#### Permissions5657* Collection Owner5859#### Parameters6061* CollectionId: ID of the collection62* Sponsor: Sponsor address63* Fee Model ID: ID of selected economic model. Currently, only "Sponsored" mode is supported, which will be ID = 1.6465### ConfirmSponsorship66#### Description67Confirm sponsorship of a collection. This call is needed to protect sponsor address from malicious collection creators.6869#### Permissions70* Collection Sponsor only7172#### Parameters73* CollectionId: ID of the collection7475### RemoveCollectionSponsor76#### Description77Switch back to pay-per-own-transaction model.7879#### Permissions80* Collection owner8182#### Parameters83* collectionId: ID of the collection8485### ClaimContract86#### Description87Claim the contract ownership for the purpose of sponsoring. Once the contract is claimed, only the contract owner can manage the contract sponsorship. Also, the contract may be claimed only once.8889#### Permissions90* Anyone9192#### Parameters93* ContractAddress: Address of the contract94* Sponsor: Sponsor address9596### SetContractSponsor97#### Description98Set the contract sponsor address. The sponsorship needs to be confirmed by sending a ConfirmContractSponsorship transaction from that address. The spam protection measures are similar to collection sponsorship.99100#### Permissions101* Contract Owner102103#### Parameters104* ContractAddress: Address of the contract105* Sponsor: Sponsor address106* Fee Model ID: ID of selected economic model. Currently, only "Sponsored" mode is supported, which will be ID = 1.107108### ConfirmContractSponsorship109#### Description110Confirm sponsorship of a contract. This call is needed to protect sponsor address from malicious sponsorship requests.111112#### Permissions113* Contract Sponsor only114115#### Parameters116* ContractAddress: Address of the contract117118### RemoveContractSponsor119#### Description120Switch back to pay-per-own-transaction model.121122#### Permissions123* Contract owner124125#### Parameters126* contractAddress: Address of the contract127128### SetPublicAccessMode129#### Description130Toggle between normal and white list access for the methods with access for “Anyone”. If White List mode is enabled, AddToWhiteList and RemoveFromWhiteList methods can be called to add to and remove addresses from the white list.131132White list mode is the property of collection. If it is turned on, all public operations such as token transfers, for example, which normally have “Anyone” permission, become white listed, i.e. are only available to collection owner, admins, and addresses from the white list. White lists can be helpful for rate limiting of transfers when collection sponsoring is enabled.133134#### Permissions135* Collection Owner136137#### Parameters138* CollectionID: ID of the Collection to set access mode for139* Mode140    * 0 = Normal141    * 1 = White list142143### AddToWhiteList144#### Description145Add an address to white list.146147#### Permissions148* Collection Owner149* Collection Admin150151#### Parameters152* CollectionID: ID of the Collection153* Address154155### RemoveFromWhiteList156#### Description157Remove an address from white list.158159#### Permissions160* Collection Owner161* Collection Admin162163#### Parameters164* CollectionID: ID of the Collection165* Address166167### SetCollectionRateLimits168#### Description169Enable or disable rate limits for a collection170171#### Permissions172* Collection Owner173* Collection Admin174175#### Parameters176* CollectionID: ID of the Collection177* TokenInterval: Number of seconds allowed between sponsored token trasnsactions. 0 means there is no limit.178* AddressInterval: Number of seconds allowed between sponsored address trasnsactions. 0 means there is no limit.179180181## User Paid Fees182183This is conventional fee model, when every Account pais for the transactions they sign and send. Transaction fee will gradually increase if the network load is higher to prevent denial of service. The same type of transaction (with the same transaction weight) will result in higher fee if previous block's weight gets close to maximum block weight. The ratio for multiplying fees will be determined empirically. The multiplication will take place until the blocks stop overpopulating, but with certain saturation. If blocks underfill, i.e. block weight is under the certain threshold, then the next block will have lower fees. The lowering will continue until blocks stop underpopulating, with some saturation.184185Each module call will have weight annotation that will determine the weight calculation for this call:186187* CreateCollection: Fixed188* ChangeCollectionOwner: Fixed189* DestroyCollection: Linear of number of items (or owner addresses, depending on the collection type) multiplied by Collection Data Size190* CreateItem: Linear of Collection Data Size191* BurnItem: Linear of Collection Data Size192* AddCollectionAdmin: Fixed193* RemoveCollectionAdmin: Fixed194* Transfers and approvals: Fixed195* Transfers with data: Fixed + linear of data size196* All other: Fixed197198This model is default and will be set for each collection until collection owner decides to change it to some other model.199200### Fee Distribution201202The fees will be burned. Incentivization is done through network token inflation, which will be designed in tokenomics.203204## Sponsored205206The only difference from User Paid Fees model is that collection owner will be paying for their users. The collection owner must have enough balance on his account in order to pay for user transactions.207208### Fee Distribution209210Same as in User Paid Fees.211212213## Prepaid Plan214215Collection Owner makes regular payments to prepay for some planned network load, i.e. some fixed number of transactions, created items, etc.216217218### Fee Distribution219220Same as in User Paid Fees.221222223## Resource Purchase224225Collection Owner purchases some fixed amount of network resource, which can be measured in number of users and their monthly transactions, for example. This is a one time payment. If Collection Owner decides to switch to a different fee model, the resources may be sold back to the system (with some commission).226227Received funds will be converted to DOTs and used in staking (nomination or validation), which will allow to receive the income that will pay for infrastructure and development support.228229### Fee Distribution230231Fixed percentage of staking income is distributed between validators proportionally to their contribution to the network. The rest is credited to the network owner.232