Giter Site home page Giter Site logo

vnrs's Introduction

VNRS

VNRS stands for Vanity Name Registration System. It is a front-running resistant smart contract application to register vanity names on Ethereum.

How?

  1. The user creates a commitment corresponding to the name he wants to register with a secret. It is a hash of user's address, name and secret.
  2. The user commits the commitment obtained in #1.
  3. The user calls register function after MIN_COMMITMENT_AGE but before MAX_COMMITMENT_AGE with the amount to be locked for NAME_LOCKING_DURATION(30 days). Registered event is emitted which denotes that the name is registered.

Steps to run

npm install
npx hardhat compile
npx hardhat test

FAQ

  1. How do you prevent front-running attacks?
    • By using commit & reveal mechanism
  2. Why is a minimum delay period of 1min required?
    • So that the reveal transaction is included in a different block than the commit transaction
  3. How happens when user renews his registration?
    • He doesn't have to pay the fees again and his initial amount are locked for another 30 days.
  4. How does the commit & reveal mechanism prevent front-running attacks?
    • The best remediation is to remove the benefit of front-running in your application, mainly by removing the importance of transaction ordering or time. - Consensys Smart Contract Best practices guide.
    • The commit transaction commits to the hash of the vanity name, user address and a secret string.
    • After the above transaction is included in the blockchain, the reveal transaction checks if the commitment is valid. If it's valid, the logic for name registration is carried out.

vnrs's People

Contributors

db2510 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

noakha

vnrs's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.