- User or some App request a new Credit Score:
requestCreditScore(string taxId, uint256 loanAmount)
- The Smart Contract make an API call through ChainLink, e.g.:
GET https://api.brx.finance/v1/credit-score?taxId=<tax-id>&loanAmount=<loan-amount>
-
ChainLink fulfill the request
-
The Smart Contract save it somehow and push a new payload to the InputBox:
bytes memory payload = abi.encode(response);
inputBox.addInput(L2_DAPP, payload);
-
Cartesi machine processes the payload (do the computations, run the risk model, etc)
-
Cartesi machine produces some output (maybe a Voucher to put in onchain, or event a Notice)