4 min read - Posted 27 Aug 19

Devcon5 Osaka online ticket Auction

The mechanics of the Devcon5 online auction

The auction mechanism takes its inspiration from Nick Johnson's ENS 1.0 auctions

When you submit a bid it is masked so that nobody can be quite certain of the size of your bid. It is only when bidding closes that you reveal the bid to the rest of the world.

There are three phases

  1. Bidding phase (1 bid per address)
  2. Reveal phase
  3. Withdrawal phase


  1. Decide how much you want to bid (bid amount)
  2. Select a random mask phrase
  3. Perform a hash of the bid amount and the mask phrase (hash value)
  4. Send the hash value in a transaction to the auction contract. This transaction must have a value greater or equal to the bid amount (mask value)

At this point, people can see your mask amount but not your bid amount.



1) You reveal your bid by sending a 0 eth transaction to the reveal method of the contract supplying the mask phrase and the bid amount.

Now your bid can be seen by everybody but nobody can submit more bids



Once the winning amount has been announced, people can withdraw excess ether

  • If you won, you can withdraw the difference between the mask amount and the bid amount
  • If you revealed but were unsuccessful your entire mask amount can be withdrawn
  • If you wait too long (after the end of the withdrawal period) you will not be able to withdraw either of the above

What you pay if you win

You pay what you bid.

If the winning amount is 10 ether and I bid 20 ether but Bob bid 15 ether?

See above. You pay 20 ether, Bob pays 15. Thank you for your support.

If the winning amount is 10 ether and a load of people have the same bid

  1. Everybody who bid > winning amount gets a ticket
  2. The remaining tickets are allocated on a first to reveal basis.

You can check the reveals by the BidRevealed event event BidRevealed(address bidder, uint256 bid);

Web based bidding process

The entire process can be carried out at https://ethercards.devcon.org

Placing your bid

During the bidding period, if you have not previously placed a bid, you will be given a mask-phrase and asked for your bid amount.

You can optionally modify the mask phrase before submission.

If you have already bid from this address you will be shown a screen telling you that you cannot bid. If you bid from this browser window you will be shown the phrase used and the bid amount (it is saved in local storage). We do not recommend relying on this - still save your phrase and bid amount.

Revealing your bid

During the reveal phase, you will be shown a field for the bid and another for the mask phrase. These will be filled from local storage if available. Accepting this will send the 0 ether transaction to reveal the bid.

And, of course if it has already been revealed.

Withdrawing your bid / the excess

After the reveal phase, a visit to the page will show if you have won or not and how much you can withdraw and a button to do so. Simply click the button.

Accessing via alternative mechanism (e.g. MyCrypto / MEW / etherscan)

Once we announce the contract address, you will be able to see the address and get the contract's ABI

Checking the stage of the auction

The following events are generated to show the parameters

    event  MinimumBid(uint256 _minimumBid);

    event BiddingPeriod( uint256 startBids, uint256 endBids);
    event RevealPeriod( uint256 startReveal, uint256 endReveal);
    event WithdrawPeriod( uint256 startWithdraw, uint256 endWithdraw);

    event WinningAmount(uint256 winningAmount);

You can also call the following functions from etherscan's contract read page

    function inBidding() public view returns (bool) 
    function inReveal() public view returns (bool) {
    function inWithdraw() public view returns (bool) {

Did you win?

    function isWinner(address check) public view returns(bool winner, bool inPeriod)

The first parameter tells you if you won The second is true during the withdrawal period


The safest way to generate the hash is to call the calculateHash function.

function calculateHash(uint256 _bid, bytes memory _randString) public pure returns (bytes32)

The submission takes place via

function biddingTime(bytes32 _hash) public payable

NOTE We cannot check that your bid is less than your mask amount. If bid > mask amount you will be unable to reveal, hence losing your ether

function reveal(uint256 _bid, bytes memory randString) public
function withdrawRefund() public
Created with Sketch.Content is"CC-BY-SA 4.0" licensed
Article On-chain
Article Author

Dave Appleton

Blockchain Developer




Related Articles
Ether Cards spreads its wings

Two or three years ago Nick Johnson, an ethereum core developer, launched Ether Cards as a simple way of onboarding people to ethereum. Credit card sized with displayable addresses and a scratch off area to hold a key phrase, Ether Cards were quickly supported by sites like MyEtherWallet and MyCrypto. By mid 2018 Ether Cards was proving useful at hackathons and conferences allowing tokens to be given out to test dApps like at Dappcon 2018 where Gnosis distributed OWL tokens for a competition bas

Dave Appleton

30 Sep 19

An Introduction to Smart Contracts with Vyper

Vyper is a smart contract-oriented, pythonic programming language that targets the Ethereum Virtual Machine (EVM). It aims to follow the similar simplicity, security and readability principles of Python and provides the following features: Bounds and overflow checking: On array accesses as well as on arithmetic level. Support for signed integers and decimal fixed point numbers Decidability: It should be possible to compute a precise upper bound for the gas consumption of any function call. Stron

Kauri Team

30 Apr 19