Git Product home page Git Product logo

exchange-deposit-standard's Introduction

A standard for deposits to exchanges and merchants

This standard if widely adopted will simplify the burden on exchanges and other entities such as merchants, who accept large numbers of deposits and payments on Ethereum. The solution being proposed is a deposit contract to be widely used, which requires the addition of a payment reference field to transactions.

Components of the standard

A payable function sendDeposit(string) with signature 0xd565365b

The exact implementation of all other aspects of the contract, such as the events and token fetching functions are not part of the standard.

The main goals of developing this standard are:

  1. Reduce burden of parsing the blockchain for all incoming transactions, and the need to issue different addresses for each customer.
  2. Ensure events are issued for all deposits, and ensure handling is the same whether deposits are sent from other contracts, including multi-signature wallet contracts, or from regular addresses.
  3. Ensure wide adoption by wallets and other exchanges for adding a payment reference into a transaction.
  4. Reduce support ticket burden on exchanges and node providers.
  5. To enable batch payments of transactions sent via a contract, without causing issues for exchanges. It is currently not easy be able to detect these incoming deposits from contracts.

Further input is required to ensure wide adoption

If possible the standard should be expanded to encompass payments and deposits with tokens.

In a similar way to the functionality of ENS, a registry contract could allow entities to register their deposit addresses. Wallet applications would ensure that for any address listed in that registry contract the end user would be asked to add an extra payment reference field in order to send a deposit to that address.

Example deposit contract using the standard

A first deposit contract is proposed with the following features:

  1. Deposits are received via the sendDeposit(string paymentReference) payable function.
  2. Only deposits with a valid supplied string payment reference are accepted, and issue a DepositReceived event. In this example the required payment reference is of the form bitfinex1234, but this can be chosen by the merchant.
  3. All other deposits, either calling the function without a valid payment reference or via the fallback function, return the sent ether to the sender, and issue a BadDepositReceived event.
  4. The contract also includes a claimTokens function allowing any ERC20 tokens sent to the contract to be retrieved by the owner and manually returned to the sender. It would be preferable to extend the contract to accept deposits of tokens, using for example the ERC223 standard proposed.

The ideal usage would be for client wallets to offer a paymentReference field and allow a user to input it if the deposit contract is found in a registry.

A second more basic usage is possible now without relying on wide scale adoption, since most wallets allow user to add a data field already to their transactions when sending ether to an address.

  1. Provide a 'payment reference' for users to copy and paste into the data field. This would be for example: 0x3958fe9e0000000000000000000000000000000000000000000000000000000000340769 , where the 0x3958fe9e represents the sendDeposit function for the contract, and 340769 is the hex payment reference.
  2. User sends the amount of ETH they wish to deposit to the deposit address, adding the data.

exchange-deposit-standard's People

Contributors

plutoegg avatar

Watchers

 avatar  avatar

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.