This repo contains the backend of the Klever NFC project developed for the SatsHack 2025 hackcathon.
This backend is reponsable to create the wallets and accounts in order to allow users to use their NFC tags to pay for events and services with L-BTC. Is also responsable to mange the recharges and and trigger the debits in the user account interacting with the Liquid network and Simplicity smart contracts.
-
make build_image -
make run_image
-
POST {{BASE_URL}}/api/btcd/walletproviding the NFC tag ID with this payload:{ "name": "{{NFC_TAG_IDENTIFIER}}" } -
POST {{BASE_URL}}/api/elements/walletproviding the NFC tag ID with this payload:{ "name": "{{NFC_TAG_IDENTIFIER}}" } -
POST {{BASE_URL}}/api/elements/accountsproviding the NFC tag ID with this payload:{ "name": "{{NFC_TAG_IDENTIFIER}}" }
- Get tag balance:
GET {{BASE_URL}}/api/elements/accounts/:tagId/balance - Recharge tag:
GET {{BASE_URL}}/api/elements/accounts/:tagId/recharge - Pay with tag:
GET {{BASE_URL}}/api/elements/accounts/:tagId/pay
The liquid network is used to process the payments for recharge the NFC tag with balance. Once user chose to recharge the tag, it will be generated a Liquid address to user deposit the balance he wants to. After the payment be confirmed, the balance will be available to the user spent using the NFC tag. Simplicity smart contract validates that the user is valid when he wants to use the NFC tag credit.