Payment Network PoC

March 19, 2020 ยท View on GitHub

Requirements

Setup cash applet

Re-install the cash applet with this command (all keys will be deleted):

keycard install -a keycard_v3.0.1.cap -f -ndef "http://test-pn.keycard.cash/simple-wallet?address={{.cashAddress}}"

You should see in the output something like http://test-pn.keycard.cash/simple-wallet?address=ADDR, where addr is the cash address.

Keycard seller - setup card and wallet

  • use a browser with metamask on Ropsten
  • if you don't have eth, request them from the faucet visiting https://faucet-ropsten.status.im/donate/PUT_HERE_YOUR_METAMASK_ADDRESS
  • Open the wallet dapp at http://test-pn.keycard.cash/wallet/
  • click on the + button
  • choose a random icon
  • leave 0.1 as max tx value
  • put the cash address using the one generated during the setup
  • click on the CREATE button (not the "connect tapping your card" button)
  • wait for the wallet to be deployed

Getting STTs (Status Test Token)

Send a transaction to 0x34358C45FbA99ef9b78cB501584E8cBFa6f85Cef with value 0 and gas 200000. You will receive 1000 STTs. After the first time, you can mine more STTs sending a tx to the same address with just 105000 of gas.

User (use any phone, web3 browser not needed)

  • tap the card on a phone (it should open the url shown at card setup)
  • click on receive
  • simulate being a friend or a shop that tops up the wallet. open another phone with Status and send a tx to that qrcode. (you can send just 0.001 eth). You need to have STT tokens.
  • in the user phone close the qrcode popup
  • wait until the TopUp tx appears
  • there's a bug, and it's loading like it's a pending tx. refresh the page :)

Merchant's Point of sale

  • open the Status browser and go to http://test-pn.keycard.cash/pos/
  • set tx amount to 1 or any value
  • click on request payment
  • tap the card
  • it should close the request screen and open the transaction screen where the merchant sign the tx and sends it
  • there's a bug in status that calculates the wrong gas when estimateGas is called. In case you see a popup with an error related to gas, refresh the page and do it again.
  • I loading spinner will show until the tx is mined
  • after that a โœ” will show, and the request payment tx will be displayed in the User phone.