Participating in TzButton with Beacon and AirGap

This game is one of the few out there which is controlled by a smart contract deployed on the Tezos blockchain. Let us explain how the game works, step by step.

AirGap
AirGap
Published in
6 min readDec 21, 2020

--

How to participate in the TzButton game using the Beacon Extension.

This guide is made to illustrate how to use Beacon to participate in this game. This is a step by step guide on how to transfer 0.2 Tez. through Beacon to participate in the TzButton game.

Participating with a Beacon compatible wallet

  1. Press the TzButton and wait for the options to show.

2. Scan the QR with a Beacon compatible wallet (In this case AirGap Wallet)

3. Once scanned you will get a permission request on your AirGap Wallet, hit connect

4. Subsequently you will now get the operation request which basically states what will happen , so 0.2 tez will be send to the SmartContract.Hit continue

5. Now you will have to sign the Transaction. Choose your setup and respectively sign the transaction.

6. Once the transaction is signed you just need to confirm it and your all set! You could be the next winner of the TzButton!

PS: If you have any questions regarding the TzButton do not hesitate to join our Telegram chat and ask your questions!

Participate in the TzButton with the Beacon Extension

Setup your Beacon Extension

1.Head to https://www.walletbeacon.io/ and download the Beacon Extension. It can also be found on the Google Chrome extension store.

2. Open the Beacon Extension and you will be asked to choose your pairing method, you can pair your AirGap Wallet or your Ledger. In this guide, we will specifically look at pairing with the AirGap Wallet.

3. The Beacon Extension will now display a QR code which you have to scan with your AirGap Wallet. Once scanned the Beacon Extension is ready to be used!

4. Once the Wallet has been paired, head to the TzButton.io site and hit the blue TzButton. You will now see a list of compatible wallets, choose the Beacon Extension.

4.Now will land on the Permission request page, hit connect and you are almost there!

5.The Operation Request page will open, which will displays the amount of tez you will send and the address (which is, in this case, 0.2 tez to the TzButton address).

6. If you’ve done everything right you will land on the Sign Transaction Page where you now have to sign your transaction with the Setup of your choice (The one which you have)

7. For the sake of this guide, the Offline Device setup will be used. If the same device option is chosen it will be all automatic and you do not have to do anything else as the transaction will be signed in seconds time and you are already participating! (However, we always advise safety first so the air-gapped approach is the most secure)

8. Your AirGap Wallet will prompt you to scan the QR displayed with your AirGap Vault. Open your AirGap Vault application on the offline device and head to the Scanner. Once scanned with the Vault, you have to sign the transaction.

9. Once you have the signed transaction QR displayed on the VAULT, head back to the Wallet and scan it with the Scanner.

10. Once scanned with your WALLET you will get to the Confirm Transaction Page

11. Hit the Confirm button and start being part of the game! Congrats you may soon own 100+ Tez.

For those of you which want to understand the logic behind the game, here is a small Use-case.

1.When clicking the button, you will add 0.2 tez to the Smart contract’s balance

2.The countdown is reset and you will become the leader, which is displayed below the button.(See image)

3. If you are the last person who has paid into the smart contract (TzButton) when the countdown expires, you can withdraw the whole balance of the smart contract.

4. Every time funds are added to TzButton, the timer gets shortened. The higher the balance is, the less the timer reduces. The countdown can reduce by as little as a split seconds, hence more 0.2 tez transactions are needed to decrease the timer by a full second.

A small example

5. Alice presses the button, 0.2 tez is now on the smart contract, the countdown is reset and the total time is reduced by 1 hour and 30 minutes, which means it’s now counting down from 22 hours and 30 minutes.

6. 1 hour and 25 minutes before the countdown expires, Bob presses the button. 0.2 tez are now in the smart contract, the countdown is reset and the total time is reduced by 45 minutes, which means it’s now counting down from 21 hours and 45 minutes.

7. Many people participate, the balance of the smart contract increases and the time each countdown lasts decreases, but the countdown never hits 0. Each transaction adds another 0.2 tez, the balance grows to 2419.8 tez and the countdown resets to 9 hours and 1 minute.

8. 5 hours and 32 minutes before the countdown expires, Charlie presses the button, 2420 tez is now on the smart contract, the countdown is reset and the total time is reduced by only around half a second, which means it’s still counting down from 9 hours and 1 minute. The countdown now changes so little that it requires multiple transactions for the countdown to decrease another second.

9. No one presses the button for more than 9 hours and 1 minute. This means Charlie is the winner.

10. Charlie can now withdraw 2420 tez, because he was the leader when the countdown ended.

Download

AirGap Wallet
💻
macOS
💻
Windows
💻
Linux
📱
iOS — App Store
📱
Android — Google Play (GitHub APK)

AirGap Vault
📱
iOS — App Store
📱 Android — Google Play (GitHub APK)

Beacon Extension

💻 Google Chrome store

TzButton

💻TzButton game

Interested in AirGap? Stay in touch.

Telegram | GitHub | Website | Twitter | Reddit

--

--