Barter Machine: An Autonomous, Distributed Barter Exchange on the Ethereum Blockchain
Keywords:Barter, Token, Smart Contract, Ethereum, Autonomous
Direct bartering allows for the trading of assets with or without the use of money. In this paper, we introduce a smart contract written in the Solidity language for the Ethereum blockchain that implements a distributed and autonomous direct barter exchange operated by crowds. Since ERC20 smart contract tokens are widely used for initial coin offerings (ICOs), our implementation provides autonomous bartering services for ERC20 tokens. The non-fungible ERC721 token, as well as Ethereum Name Service (ENS) name bartering, are also supported. Because finding a feasible bartering solution for bids involving multiple tokens is NP-hard in general, our exchange only provides escrow and swapping services. It assumes feasible solutions are submitted by bartering problem solvers from the crowd who run a solver locally on their machines. Bartering problem solvers are incentivized to submit solutions to the autonomous exchange by awarding them with excess tokens that are left over after granting the bidders the tokens they requested in their bids. Our system, called BarterMachine, can perhaps be used to facilitate a global barter economy. The BarterMachine prototype is available for testing on the Ethereum Ropsten network at https://bartermachine.github.io/bartermachine/ropsten/.
Abraham, D. J., Blum, A., Sandholm, T. “Clearing Algorithms for Barter Exchange Markets: Enabling Nationwide Kidney Exchanges.” In Proceedings of the 8th ACM Conference on Electronic Commerce ACM 295–304 (2007).
Bang-Jensen, J., Gutin, G. Digraphs: Theory, Algorithms and Applications, Second Edition. Springer 683-684 (2009).
Concourse Open Community. “Recommended Gas Prices in Gwei.” ETH Gas Station (accessed 21 May 2020) https://ethgasstation.info/.
Dezső, B., Jüttner, A., Kovács, P. “LEMON–An Open Source C++ Graph Template Library.” Electronic Notes in Theoretical Computer Science 264.5 23–45 (2011).
Dijkstra, E. W. “The Mathematics Behind the Banker’s Algorithm.” In Selected Writings on Computing: A Personal Perspective Springer 308–312 (1982).
Glorie, K. M., van de Klundert, J. J., Wagelmans, A. P. “Kidney Exchange with Long Chains: An Efficient Pricing Algorithm for Clearing Barter Exchanges with Branch-and-Price.” Manufacturing & Service Operations Management 16.4 498–512 (2014).
Goldberg, A. V. “An Efficient Implementation of a Scaling Minimum-Cost Flow Algorithm.” Journal of Algorithms 22.1 1–29 (1997).
Jevons, W. S. Money and the Mechanism of Exchange. New York: D. Appleton and Co. (1876).
No Author. “Gurobi Optimization.” Gurobi (accessed 21 May 2020) http://www.gurobi.com/.
No Author. “MetaMask.” MetaMask (accessed 21 May 2020) https://metamask.io/.
No Author. “Solidity Documentation.” Solidity (accessed 21 May 2020) https://solidity.readthedocs.io.
No Author. “vis.js.” vis.js (accessed 21 May 2020) https://visjs.org/.
Özer, A. H., Özturan, C. “A Direct Barter Model for Course Add/Drop Process.” Discrete Applied Mathematics 159.8 812–825 (2011).
Özturan, C. “On Finding Hypercycles in Chemical Reaction Networks.” Applied Mathematics Letters 21.9 881–884 (2008).
Özturan, C. “Resource Bartering in Data Grids.” Scientific Programming 12.3 155–168 (2004).
Özturan, C. “Used Car Salesman Problem: A Differential Auction–Barter Market.” Annals of Mathematics and Artificial Intelligence 44.3 255–267 (2005).
Szudzik, M. “An Elegant Pairing Function.” In NKS2006 Conference (2006) http://www.szudzik.com/ElegantPairing.pdf.
Vogelsteller, F., Buterin, V. “ERC-20 Token Standard.” Github (accessed 21 May 2020) https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md.
How to Cite
Authors who publish with this journal agree to the following terms:
- The Author retains copyright in the Work, where the term “Work” shall include all digital objects that may result in subsequent electronic publication or distribution.
- Upon acceptance of the Work, the author shall grant to the Publisher the right of first publication of the Work.
- The Author shall grant to the Publisher and its agents the nonexclusive perpetual right and license to publish, archive, and make accessible the Work in whole or in part in all forms of media now or hereafter known under a Creative Commons Attribution 4.0 International License or its equivalent, which, for the avoidance of doubt, allows others to copy, distribute, and transmit the Work under the following conditions:
- Attribution—other users must attribute the Work in the manner specified by the author as indicated on the journal Web site;
- The Author is able to enter into separate, additional contractual arrangements for the nonexclusive distribution of the journal's published version of the Work (e.g., post it to an institutional repository or publish it in a book), as long as there is provided in the document an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post online a prepublication manuscript (but not the Publisher’s final formatted PDF version of the Work) in institutional repositories or on their Websites prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work. Any such posting made before acceptance and publication of the Work shall be updated upon publication to include a reference to the Publisher-assigned DOI (Digital Object Identifier) and a link to the online abstract for the final published Work in the Journal.
- Upon Publisher’s request, the Author agrees to furnish promptly to Publisher, at the Author’s own expense, written evidence of the permissions, licenses, and consents for use of third-party material included within the Work, except as determined by Publisher to be covered by the principles of Fair Use.
- The Author represents and warrants that:
- the Work is the Author’s original work;
- the Author has not transferred, and will not transfer, exclusive rights in the Work to any third party;
- the Work is not pending review or under consideration by another publisher;
- the Work has not previously been published;
- the Work contains no misrepresentation or infringement of the Work or property of other authors or third parties; and
- the Work contains no libel, invasion of privacy, or other unlawful matter.
- The Author agrees to indemnify and hold Publisher harmless from Author’s breach of the representations and warranties contained in Paragraph 6 above, as well as any claim or proceeding relating to Publisher’s use and publication of any content contained in the Work, including third-party content.
- The Author agrees to digitally sign the Publisher’s final formatted PDF version of the Work.
Revised 7/16/2018. Revision Description: Removed outdated link.