-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SRC20 Token Deployment Front-Running Prevention #305
Comments
A good idea. However if this is mostly for those wanting to mint 100% of the tokens deployed then the ‘premine’ alternative is probably better suited. Not opposed to doing both options if we are putting a few upgrades into the next release however. |
Yeah. I believe that most of the situation by now is minting 100% tokens at the deployment. The commit and reveal mechanism is to prevent front-running the token name and others parameters, like supply etc. |
How will the indexer know the token name at time of commitment to ‘reserve’ that name for the commiter considering it’s obscured in the sha hash? I guess there would still be a more minimal risk there if someone else happened to use the tick name before the reveal transaction posted. Seems a little overly complex when a deploy in the current method could just use a high fee if it was a high value token name? |
I guess that would be resolved by making all deploys require this technique. I was initially thinking it could be optional. |
I guess I don't see how the issue is solved if this is optional deploy technique. someone could still see the reveal in the mempool and quickly deploy the same token in the old technique. There is nothing on the commit where the indexer can reserve the nam. The downside is the two transactions for a deploy. |
I think optional is fine considering the simplicity of current way. Anyway, just propose an idea about how we can avoid the Front-Running issue. |
Issue2(Allow to mint all tokens at once and prevent other users from front-running the minting. |
Recently, many users have reported to OpenStamp that SRC20 Tokens are being front-run deployed and minted, especially for projects that wish to mint all tokens at once. To address the following two issues:
After a brief discussion with Kevin, OpenStamp has proposed the following preliminary ideas to address the above issues.
Adopt a two-phase process, where the deployer needs to send a commit transaction and a reveal transaction.
The JSON data structure of the commit transaction is as follows:
The commitment address is the first input address of the commit transaction. The above commit transaction requires three Bare Multi-Sig Outputs.
The JSON data structure of the reveal transaction is as follows:
A reveal transaction is considered valid if it meets the following conditions:
The commitment for the reveal transaction is calculated as follows: SHA-256(first input address of reveal transaction + tick)
Additionally, the first output of the reveal transaction will be the deployer address.
Below is the TypeScript method to calculate the commitment hash:
The text was updated successfully, but these errors were encountered: