1.7K Followers
·
Follow

Quant — Payment Channels Challenge

Announcing our Payment Channels & Escrow Deposit Smart Contract Interaction Challenges

11 August 2020 – 25 August 2020

Today sees the release of the first batch of testnet Payment Channels and Escrow Deposit contracts relating to the Overledger Network.

For background information on these topics, see:

· Overledger Network: https://www.quant.network/overledger-network-for-community-whitepaper/

· Overledger Network Treasury: https://medium.com/@quant_network/overledger-network-treasury-d5c9dcebe894

As Quant Network has such an enthusiast and engaging community, we have decided to also release some challenges for the first batch of users.

Note that for the challenges below, you will certainly require testnet ETH from a Ropsten faucet (there are a few available online). You may also require more testnet QNT. In this case, call the “getTestQNT” function of the Ropsten testnet QNT faucet at address:

0x8a97cbDAf2181835AD93b1a5D63EbE3df1C47814

The testnet QNT faucet will give out 500 testnet QNT only if your testnet QNT balance is less than 500.

Become a Master of Payment Channel & Escrow Smart Contracts

Image for post
Photo by Ian Stauffer on Unsplash

Complete this section’s numbered challenges to become a Payment channel and Escrow deposit smart contract master!

There are Quant prizes for answering the questions highlighted in the sections below. These prizes can be claimed by sending your answers (and any relevant transaction hashes) to support@quant.network, where these answers will be evaluated.

A subsection of responders will receive a prize. Prizes for these challenges will be awarded at our discretion based on different factors such as quality of response and knowledge of the Overledger Network. Note that prizes will *not* be awarded according to speed.

Answers and Prizes to these challenges will be made public after 2 weeks and names will be published in our Hall of Fame post on Medium.

Note that your payment channels will be locked for one week. After which you can extend the lock time if required.

NOTE: The challenges are strictly related to the 12 tasks below in Part A-C. No malicious acticity such as DDoS, DoS, hacking other users, hacking Quant infrastructure and services or any other malicious activity will be tolerated. Any malicious activity will result in instant disqualification, banning from the Quant ecosystem and reporting to the appropriate authorities.

Image for post

PART A — Getting Started Tests

1. Use the blockchain to check the address of your Payment Channel & Escrow Deposit smart contract.

a) Your smart contract addresses are indexed by your operator address at the treasury factory smart contract

0x4a42AA05fB7cd58E9e388c82ec11b811bdf5aDa7

b) You can use Etherscan for simple interactions with this contract via https://ropsten.etherscan.io/address/0x4a42aa05fb7cd58e9e388c82ec11b811bdf5ada7#readProxyContract

i. If you are a gateway owner, add your operator address into the function “gatewayChannel” to receive your Payment Channel smart contract address. Additionally, add your operator address into the function “gatewayDeposit” to receive your Escrowed Deposit smart contract address.

ii. If you are a developer, add your operator address into the function “mappChannel” to receive your Payment Channel smart contract address. Additionally, add your operator address into the function “mappDeposit” to receive your Escrowed Deposit smart contract address.

2. Check the Operator & QNT Addresses stored within your Payment Channel & Escrow Deposit smart contract.

a) Now that you have your addresses from the blockchain, browse to them on Etherscan. For each smart contract, select the “Contract” tab, then the “Read Contract” section.

b) For both contracts: Check that the “MAPPorGatewayOperatorAddress” matches your operator address

c) For both contracts: Check that the “MAPPorGatewayQNTAddress” matches your QNT address

d) For both contracts: Check that the “readQNTBalance” parameter is as you expect (recall that QNT has 18 decimal places). How do you know this balance relates to the testnet QNT smart contract (i.e. how do we know that this balance is for testnet QNT and not for some other unit)?

e) For the Payment Channel: What is the “currentNonce” parameter?

f) For both contracts: What does the expiration parameter mean? In what unit is it? Where are both contracts taking this parameter from? And what conditions need to be met for the smart contracts to expire?

g) For the Escrow Deposit: Why is it connected to the payment channel?

h) For both contracts: Why are they both connected to the treasury contract?

PART B — Payment Channel and Smart Contracts Tests

Image for post

3. Increasing the QNT balance of your smart contracts.

a) Can you demonstrate how to increase the QNT of your Escrow Deposit smart contract (provide transaction hash)?

b) Can you demonstrate how to increase the QNT of your Payment Channel smart contract (provide transaction hash)? And do you know who will do this when the Overledger Network reaches production stage?

4. Withdraw your QNT after timeout.

a) Once your smart contract lockups timeout, can you demonstrate how to withdraw QNT from your Escrow Deposit smart contract (provide transaction hash)?

b) [OVN developer role only] Once your smart contract lockups timeout, can you demonstrate how to withdraw QNT from your Payment Channel smart contract (provide transaction hash)?

5. [OVN developer role only] Can you demonstrate how to push a 15 QNT payment through your payment channel on chain (provide transaction hash)?

6. [OVN developer role only] Can you demonstrate how to increase the timeout of your payment channel by 72 hours (provide transaction hash)?

PART C — Payment Channel & Escrow Deposit Smart Contract Resilience Tests

Image for post
Photo by Fotis Fotopoulos on Unsplash

We have also set up some channels to demonstrate the resilience of our payment channel technology.

Bug bounties can be claimed if you send relevant transaction hashes to support@quant.network, which show functionality described in the section headings below. These transaction hashes will then be evaluated to check that they actually have uncovered a code bug. You will have the chance to win different Quant prizes such as shirts, stickers and gear. We will only have 1 batch of these prizes and will only be used for this challenge.

7. Withdraw QNT from your Escrowed Deposit smart contract before the expiration time

· You should not be able to do this, as QNT should remain locked in the Escrow Deposit contract until the expiration time.

8. [OVN developer role only] Withdraw QNT from a Payment Channel as the sender.

· You should not be able to do this, as QNT should remain locked in the Payment Channel contract until the expiration time, unless it is claimed by the receiver’s operator address.

9. Lower the expiration time of your Payment Channel and/or Escrowed Deposit smart contracts

· You should not be able to this, as it would lower the expected lock time of the QNT.

10. Use an address to withdraw QNT from an Escrow Deposit Smart Contract not associated with your address.

· You should not be able to do this, as it would mean locked QNT is insecure

11. Use an address to withdraw QNT from a Payment Channel Smart Contract not associated with your address.

· You should not be able to do this, as it would mean locked QNT is unsecure

12. Using a gateway’s operator address, private key, and a timed out Escrow Deposit contract withdraw the gateway’s QNT stake to an address that you control.

· You should not be able to access the Escrow Deposit’s QNT, as it should only be routed to the Gateway’s QNT address (cold wallet)

· Gateway operator address:

0xD0D933329be61ce212F6628414d892dB9A16cbE8

· Gateway’s operator private key:

0xa3f20160cb801f2150dcc76081e600fdaf54586c0ae273480b4650a53802ef69

(note that some wallet implementations may not use the 0x)

· Gateway’s Escrow Deposit Contract:

0x3ab128453ad489EebAf77C5d99BBE544547A6D40

13. Using the given developer’s operator address, private key and a timed out payment channel, withdraw the QNT in the payment channel to an address that you control.

· You should not be able to access a Developer’s QNT, as it should only be routed to the Developer’s QNT address (cold wallet)

· Developer operator address:

0x95854C4aE3b36027eeb3A6fFBb3288319d5eC0Cc

· Developer’s operator private key:

0x9f150722897f7d6cc373cbf0ac408c86f91ba007361dcc85c2412e349cd14cd1

(note that some wallet implementations may not use the 0x)

· Developer’s Payment Channel Contract:

0xDDb0F3cf3395d2CcC2BD085754dc185E107b7A58

14. Using the given developer’s operator address, private key and a timed out escrow deposit smart contract, withdraw the QNT in the escrow deposit to an address that you control.

· You should not be able to access a Developer’s QNT, as it should only be routed to the Developer’s QNT address (cold wallet)

· Developer operator address:

0x95854C4aE3b36027eeb3A6fFBb3288319d5eC0Cc

· Developer’s operator private key:

0x9f150722897f7d6cc373cbf0ac408c86f91ba007361dcc85c2412e349cd14cd1

(note that some wallet implementations may not use the 0x)

· Developer’s Escrow Deposit Contract:

0x80e7a27b5185f3998C5FDbC6C7D2052Abb679F4a

Good Luck with the Quant Challenges! We hope to hear about your results and publish on the Quant Hall of Fame!

Please submit any of your results to support@quant.network anytime between the 11–25 August 2020.

Image for post

Written by

Quant is committed to unleashing the power of systems that are as connected as the world we live in.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store