cl-hackathon fall 2021 decentralized escrow utilizing open banking api
- Register a tink account to attain client id and client secret
- Enable continuous access
- Save 'client_id', 'client_secret' and 'actor_client_id' to .env
- Set up bridge and external adapter
- Seller completes tink authentication with bridge
- Node operator generates bearer token
- Node operator creates tink 'user_id' (using bearer token)
- Node operator generates auth code (using bearer token)
- Node operator initiates credentials creation (using auth code)
- Node operator sends credentials creation url to Seller
- Seller opens url with browser and completes authentication (ex. BankID)
- Callback to app/Seller registers 'credentialsId' with node operator
- Node operator adds 'credentialsId' and 'user_id' to .env
- Node operator deploys TinkConsumer.sol which is linked to Sellers bank account
- Seller funds TinkConsumer contract with LINK
- Seller lists offer
- Buyer notifies Seller
- Buyer and Seller both call initContract
- Seller deposits funds to SC through depositFunds(), SC moves from State 'AWAITING_FUNDS' to 'AWAITING_FULFILLMENT'
- Buyer deposits fiat to sellers bank account (Off-chain)
- The function confirmBalance() is called until either condition is triggered
- tinkBalance >= (initBalance + price), SC pays out funds to Buyer, SC moves from State 'AWAITING_FULFILLMENT' to 'FINISHED'
- (to be implemented; timer/timeout)
- web3 application interface which handles offers and contract initialization
- integration with tink authentication, move credentials_id automatically to node
- add separate contract state awaiting tink authentication, node operator should trigger this event after account has been verified
- in this stage the node operator should also verify that the bank account is reachable
- buyer should deposit collateral to avoid spoofing
- add a timer to avoid credentials timeout and funds being stuck forever
- buyer and seller should deposit collateral and funds through application interface
- if seller never deposits funds, collateral should be withdrawable by buyer
- buyer should receive sellers IBAN through the app
- seller must not be able to withdraw received fiat before confirmBalance is called
