difftreelog
Update economic model docs
in: master
1 file changed
doc/economic_model.mddiffbeforeafterboth889We are going to offer several fee models for our users. Some models will be implemented immediately, some will wait until there is a demand. 9We are going to offer several fee models for our users. Some models will be implemented immediately, some will wait until there is a demand. 101011The fee models are setup by Collection. Every Collection has a fee model assigned to it, which determines how collection transactions are paid. Network users can choose the fee model that better suits their application. The Collection fee model can be changed later as well.11The 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.121213Initially we offer 4 models for consideration:13Initially we offer 4 models for consideration:141415* User paid fees15* User paid fees (conventional blockchain method)16* Pay as you go16* Sponsored (same as above, but paid by sponsor)17* Prepaid plan17* Prepaid plan18* Resource purchase18* Resource purchase1919232324User Account matches to user address in the network. Among other properties user Account has Balance, which will be used later on.24User Account matches to user address in the network. Among other properties user Account has Balance, which will be used later on.252526## Changing Fee Model26## Settings Economic Model272728The dedicated module call will be added to allow updating fee structure for the collection.28The dedicated pallet calls allow updating the fee structure for the collection or smart contract.292930### SelectFeeModel Call30### SetCollectionSponsor313132#### Description32#### Description333334Select fee model for a given collection.34Set 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.353536##### 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).5436#### Permissions55#### Permissions375638* Collection Owner57* 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 Owner39* Collection Admin149* Collection Admin4015041#### Parameters151#### Parameters152* CollectionID: ID of the Collection153* Address4215443* Collection ID155### RemoveFromWhiteList156#### Description44* Fee Model ID157Remove an address from white list.45158159#### 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.17918046## User Paid Fees181## User Paid Fees4718248This 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.183This 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.5118652* CreateCollection: Fixed187* CreateCollection: Fixed53* ChangeCollectionOwner: Fixed188* ChangeCollectionOwner: Fixed54* DestroyCollection: Linear of number of items multiplied by Collection Data Size189* DestroyCollection: Linear of number of items (or owner addresses, depending on the collection type) multiplied by Collection Data Size55* CreateItem: Linear of Collection Data Size190* CreateItem: Linear of Collection Data Size56* BurnItem: Linear of Collection Data Size191* BurnItem: Linear of Collection Data Size57* AddCollectionAdmin: Fixed192* AddCollectionAdmin: Fixed58* RemoveCollectionAdmin: Fixed193* RemoveCollectionAdmin: Fixed59* GetOwner: None194* Transfers and approvals: Fixed60* BalanceOf: None195* Transfers with data: Fixed + linear of data size61* Transfer: Fixed196* All other: Fixed6219763This model is default and will be set for each collection until collection owner decides to change it to some other model.198This model is default and will be set for each collection until collection owner decides to change it to some other model.641996566### Fee Distribution200### Fee Distribution6768The network owner will reserve some fixed percentage of fees, and the rest will be distributed among validators proportionally to their contribution to the network.697020171## Pay As You Go202The fees will be burned. Incentivization is done through network token inflation, which will be designed in tokenomics.7220373The 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. If balances goes lower than needed, the model is temporarily switched to "User Paid Fees".204## Sponsored74205206The 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.7520776### Fee Distribution208### Fee Distribution77209