git.delta.rocks / unique-network / refs/commits / 3e483e788323

difftreelog

Update economic model docs

Greg Zaitsev2020-09-10parent: #a334016.patch.diff
in: master

1 file changed

modifieddoc/economic_model.mddiffbeforeafterboth
88
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. 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.
1010
11The 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.
1212
13Initially we offer 4 models for consideration:13Initially we offer 4 models for consideration:
1414
15* 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 plan
18* Resource purchase18* Resource purchase
1919
2323
24User 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.
2525
26## Changing Fee Model26## Settings Economic Model
2727
28The 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.
2929
30### SelectFeeModel Call30### SetCollectionSponsor
3131
32#### Description32#### Description
3333
34Select 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.
3535
36##### List of transactions
37Transactions that can be sponsored:
38* Transfer
39* Approve
40* TransferFrom
41* TransferWithData
42* TransferFromWithData
43* BurnItem
44
45##### Rate Limiting
46
47This is a design proposal, actual implementation may change.
48
49Features:
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).
54
36#### Permissions55#### Permissions
3756
38* Collection Owner57* Collection Owner
58
59#### Parameters
60
61* CollectionId: ID of the collection
62* Sponsor: Sponsor address
63* Fee Model ID: ID of selected economic model. Currently, only "Sponsored" mode is supported, which will be ID = 1.
64
65### ConfirmSponsorship
66#### Description
67Confirm sponsorship of a collection. This call is needed to protect sponsor address from malicious collection creators.
68
69#### Permissions
70* Collection Sponsor only
71
72#### Parameters
73* CollectionId: ID of the collection
74
75### RemoveCollectionSponsor
76#### Description
77Switch back to pay-per-own-transaction model.
78
79#### Permissions
80* Collection owner
81
82#### Parameters
83* collectionId: ID of the collection
84
85### ClaimContract
86#### Description
87Claim 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.
88
89#### Permissions
90* Anyone
91
92#### Parameters
93* ContractAddress: Address of the contract
94* Sponsor: Sponsor address
95
96### SetContractSponsor
97#### Description
98Set 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.
99
100#### Permissions
101* Contract Owner
102
103#### Parameters
104* ContractAddress: Address of the contract
105* Sponsor: Sponsor address
106* Fee Model ID: ID of selected economic model. Currently, only "Sponsored" mode is supported, which will be ID = 1.
107
108### ConfirmContractSponsorship
109#### Description
110Confirm sponsorship of a contract. This call is needed to protect sponsor address from malicious sponsorship requests.
111
112#### Permissions
113* Contract Sponsor only
114
115#### Parameters
116* ContractAddress: Address of the contract
117
118### RemoveContractSponsor
119#### Description
120Switch back to pay-per-own-transaction model.
121
122#### Permissions
123* Contract owner
124
125#### Parameters
126* contractAddress: Address of the contract
127
128### SetPublicAccessMode
129#### Description
130Toggle 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.
131
132White 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.
133
134#### Permissions
135* Collection Owner
136
137#### Parameters
138* CollectionID: ID of the Collection to set access mode for
139* Mode
140 * 0 = Normal
141 * 1 = White list
142
143### AddToWhiteList
144#### Description
145Add an address to white list.
146
147#### Permissions
148* Collection Owner
39* Collection Admin149* Collection Admin
40150
41#### Parameters151#### Parameters
152* CollectionID: ID of the Collection
153* Address
42154
43* Collection ID155### RemoveFromWhiteList
156#### Description
44* Fee Model ID157Remove an address from white list.
45158
159#### Permissions
160* Collection Owner
161* Collection Admin
162
163#### Parameters
164* CollectionID: ID of the Collection
165* Address
166
167### SetCollectionRateLimits
168#### Description
169Enable or disable rate limits for a collection
170
171#### Permissions
172* Collection Owner
173* Collection Admin
174
175#### Parameters
176* CollectionID: ID of the Collection
177* 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.
179
180
46## User Paid Fees181## User Paid Fees
47182
48This 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.
51186
52* CreateCollection: Fixed187* CreateCollection: Fixed
53* ChangeCollectionOwner: Fixed188* ChangeCollectionOwner: Fixed
54* 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 Size
55* CreateItem: Linear of Collection Data Size190* CreateItem: Linear of Collection Data Size
56* BurnItem: Linear of Collection Data Size191* BurnItem: Linear of Collection Data Size
57* AddCollectionAdmin: Fixed192* AddCollectionAdmin: Fixed
58* RemoveCollectionAdmin: Fixed193* RemoveCollectionAdmin: Fixed
59* GetOwner: None194* Transfers and approvals: Fixed
60* BalanceOf: None195* Transfers with data: Fixed + linear of data size
61* Transfer: Fixed196* All other: Fixed
62197
63This 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.
64199
65
66### Fee Distribution200### Fee Distribution
67
68The network owner will reserve some fixed percentage of fees, and the rest will be distributed among validators proportionally to their contribution to the network.
69
70201
71## Pay As You Go202The fees will be burned. Incentivization is done through network token inflation, which will be designed in tokenomics.
72203
73The 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## Sponsored
74205
206The 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.
75207
76### Fee Distribution208### Fee Distribution
77209