feat: taproot asset backend #815
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces initial support for Taproot Assets by implementing a new funding source: the TapRestWallet. This wallet backend interacts with a Lightning Terminal Daemon (like litd via a REST interface) to enable the mint to handle Taproot Asset on the Lightning Network.
Key Changes and Implementation Details
Adds cashu/lightning/taprest.py, which contains the TapRestWallet class, providing a LightningBackend interface for Taproot Assets operations (specifically targeting litd's REST API).
Unit Support: Temporarily uses Unit.thb as a placeholder for a generic "Taproot Asset Unit" in the backend implementation, which will likely need to be generalized/abstracted in future iterations.
Adds a new configuration section TapRestFundingSource to cashu/core/settings.py and the respective variables to .env.example.
New Environment Variables: Introduces settings for connecting to the Taproot Assets service: MINT_TAP_REST_ENDPOINT, MINT_TAP_REST_CERT, MINT_TAP_REST_CERT_VERIFY
Authentication Macaroons: MINT_TAP_REST_LND_MACAROON (for LND/Lightning operations) and MINT_TAP_REST_TAP_MACAROON (for Taproot Assets operations).
Asset Identifiers: MINT_TAP_REST_ASSET_ID (the ID of the asset this mint will handle) and MINT_TAP_REST_PEER_PUBKEY.
Minor adjustments to cashu/core/base.py to allow the use of Unit.thb in amount calculations, supporting the chosen unit for the Taproot Asset.