-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEP-362: Greenfield Storage Fee Paymaster #362
Conversation
When creating a bucket, users can specify a payment address for the bucket to make payments. | ||
|
||
``` | ||
message MsgCreateBucket { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain a bit what this MsgCreateBucket
is?
BEPs/BEP-362.md
Outdated
However, in the new design, we allow this payment address to be any address. | ||
|
||
Users can specify any payment address when creating the bucket. But if the payment address does not set a flow rate | ||
limit(which you can refer to below sections) for the bucket, they may not use the bucket normally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which you can refer to below sections
==> I think Markdown support jump to the section, let us change it.
BEPs/BEP-362.md
Outdated
When the payment account’s owner of a bucket is different from the bucket owner, it is necessary to check if the current | ||
payment flow exceeds the flow rate limit when deducting charges for streaming payments. | ||
|
||
The payment account owner can use the MsgSetBucketFlowRateLimit transaction to set the maximum payment flow size for a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change MsgSetBucketFlowRateLimit to MsgSetBucketFlowRateLimit
, always hightlight the special wording.
BEPs/BEP-362.md
Outdated
|
||
The payment account owner can use the MsgSetBucketFlowRateLimit transaction to set the maximum payment flow size for a | ||
specific bucket. The default flow rate limit is 0, but if the payment account is owned by the bucket owner, the default | ||
flow rate limit is unlimited. If the payment account owner hasn't set a flow rate limit for the bucket, users can't create any objects in it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or use any read quota
BEPs/BEP-362.md
Outdated
} | ||
``` | ||
|
||
The payment account owner can send a MsgSetBucketFlowRateLimit transaction on the Greenfield side to set the flow rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hightlight MsgSetBucketFlowRateLimit
please.
BEP-362: Greenfield Storage Fee Paymaster
1. Summary
The BEP introduces a storage fee paymaster solution for sponsors to cover storage costs on Greenfield, making it easier
for regular users to utilize the platform. Currently, users need to pay the storage fee for the buckets by themselves,
so they need to hold BNB in Greenfield and understand the charging mechanism. Allowing the sponsors to pay the storage
fee for the users will make it easier to use Greenfield.
2. Motivation
Objects stored on Greenfield incur storage fees, with additional data access incurring read traffic fees.
Greenfield employs stream payment to charge for storage and read traffic. For regular users, grasping the concept of
stream payment and knowing when to renew can be challenging. Users need to know what is the stream payment and they
need to calculate the cost of the BNB according to the price of storage which is confusing for normal users.
To address this, we aim to introduce the Paymaster approach, enabling sponsors to cover storage and read traffic costs for their users seamlessly.
3. Status
This BEP is in progress.
4. Specification
4.1 Create and update bucket
When creating a bucket via
MsgCreateBucket
, users can specify a payment address for the bucket to make payments.In previous implementations, this payment address had to be the bucket owner or be created by the bucket owner.
However, in the new design, we allow this payment address to be any address.
Users can specify any payment address when creating the bucket. But if the payment address does not set a flow rate
limit(which you can refer to below section) for the bucket, they may not use the bucket normally.
Users can also update the payment address for the bucket via the
MsgUpdateBucketInfo
by specifying the payment addressto be replaced if they want to use another payment address after creating the bucket.
We recommend setting the bucket's payment address to the sponsor's payment address for optimal convenience and flexibility.
4.2 Set the flow rate limit for a bucket
When the payment account’s owner of a bucket is different from the bucket owner, it is necessary to check if the current
payment flow exceeds the flow rate limit when deducting charges for streaming payments.
The payment account owner can use the
MsgSetBucketFlowRateLimit
transaction to set the maximum payment flow size for aspecific bucket. The default flow rate limit is 0, but if the payment account is owned by the bucket owner, the default
flow rate limit is unlimited. If the payment account owner hasn't set a flow rate limit for the bucket, users can't create
any objects in it or set read quota for the bucket.
The payment account owner can send a
MsgSetBucketFlowRateLimit
transaction on the Greenfield side to set the flow ratelimit for a bucket. However, this process requires maintaining a backend program to detect the creation of a qualifying
bucket and trigger the transaction for setting it up. A more recommended approach would be to wait for the implementation
of the GreenfieldExecutor contract in another BEP for improving Greenfield cross-chain programming capability to enable
setting flow rate limits via smart contract. Once this is in place, users can directly create buckets on the BSC/opBNB
side and specify a payment address as a contract address. By doing so, users can simultaneously create a bucket and invoke
the payment contract address to set the flow rate limit, eliminating the need for backend transaction triggers and enabling
automatic flow rate limit configuration.
The payment account owner can adjust the flow rate limit for the bucket. The rules for adjusting the limit are as follows:
4.3 Update bucket payment address
When the payment account no longer pays for the bucket or the bucket is rate-limited by the current payment account,
the bucket owner can update the payment address to continue using the bucket. In this case, users will need to utilize
the new payment address for making payments.
5. License
The content is licensed under CC0.