Skip to content
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

Add first draft of blind auctions EIP #1815

Closed
wants to merge 12 commits into from
75 changes: 75 additions & 0 deletions EIPS/eip-1815.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
eip: 1815
title: Interface for blind auctions
author: Albert Acebrón (@corollari)
discussions-to: https://github.com/ethereum/EIPs/issues/1745
status: Draft
type: Standards Track
category: ERC
created: 2019-03-04
requires: 165
---
axic marked this conversation as resolved.
Show resolved Hide resolved


## Simple Summary
Standard interface for contracts implementing blind auctions.

## Abstract
Currently there doesn't exist any standard interface/contract for blind auctions, creating a void that has been filled with many de-facto standards such as the one used by ENS[1] or the one used in the blind auction contract present in Solidity's documentation[2]. This ERC aims to remove this fragmentation by proposing a standard interface for blind auction contracts.

## Motivation
Many different implementations of blind auctions [1][2][3][4][5] have appeared in the last years, each one reinventing the wheel and implementing blind auctions in ways that are conceptually similar but with special quirks and different interfaces, thus making it impossible for a system to interact with all of these without accommodating all these differences. This ERC aims to solve that by standarizing an interface for blind auctions contracts, which will enable the creation of systems that can interact with any blind auctions without requiring specialized code.

## Specification
```solidity
pragma solidity ^0.5.0;

/// @title ERC-1815 Interface for blind auctions
/// @dev See https://eips.ethereum.org/EIPS/eip-1815
/// Note: the ERC-165 identifier for this interface is 0xe3594b02.
interface ERC1815 /* is ERC165 */ {
enum Mode { Open, Auction, Owned, Forbidden, Reveal, NotYetAvailable }

event AuctionStarted(bytes32 indexed hash, uint registrationDate);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to comment (perhaps using NatSpec) each of these interfaces as done in other ERCs. See http://eips.ethereum.org/EIPS/eip-721 as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will start working on it

event NewBid(bytes32 indexed hash, address indexed bidder, uint deposit);
event BidRevealed(bytes32 indexed hash, address indexed owner, uint value, uint8 status);
event HashRegistered(bytes32 indexed hash, address indexed owner, uint value, uint registrationDate);

function startAuction(bytes32 _hash) external;
function startAuctions(bytes32[] calldata _hashes) external;
function newBid(bytes32 sealedBid) external payable;
axic marked this conversation as resolved.
Show resolved Hide resolved
function startAuctionsAndBid(bytes32[] calldata hashes, bytes32 sealedBid) external payable;
function unsealBid(bytes32 _hash, uint _value, bytes32 _salt) external;
function cancelBid(address bidder, bytes32 seal) external;
function finalizeAuction(bytes32 _hash) external;
function entries(bytes32 _hash) external view returns (Mode, address, uint, uint, uint);
}

/// @dev See https://eips.ethereum.org/EIPS/eip-165
interface ERC165 {
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
```

## Rationale
The interface proposed has been chosen because it is the one used by the Ethereum Name System, which is the most popular project among the ones that use blind auctions, therefore being the one that has the most systems that integrate with it. By picking this interface we aim at minimizing the total amount of work that will be needed to migrate existing systems to the interface proposed, while maximizing the number of systems that will already be compatible with a contract implementing the interface described.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is an exact copy of what ENS is using, maybe it would be courteous to include the ENS authors in the author field of the ERC?

Copy link
Contributor Author

@corollari corollari May 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've previously contacted some of them and they didn't seem interested in being authors but I'll try to contact the others.
Edit: If someone else (from the ENS or not) is interested in authoring this EIP along with me please reach out!


## Backwards Compatibility
This EIP is backwards compatible with the Ethereum Name Service's blind auctions, the blind auction contract in the ETH community that has gained more traction and has the most systems interacting with it.

## Test Cases
Not needed.

## Implementation
[ENS' implementation](https://github.com/ensdomains/ens/blob/94f4861a7783d8986e81b976e823caa81a16f285/contracts/HashRegistrar.sol)
[corollari's clean room implementation](https://github.com/corollari/BlindAuction)

## References
[1] [ENS](https://ens.domains/)
[2] [Blind auction in solidity's documentation](https://solidity.readthedocs.io/en/develop/solidity-by-example.html#blind-auction)
[3] [WaifuChain](https://waifuchain.moe)
[4] [Implementation using a FSM](https://arxiv.org/abs/1711.09327)
[5] [Implementation in a Solidity tutorial](https://programtheblockchain.com/posts/2018/03/27/writing-a-sealed-bid-auction-contract/)

## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).