Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core Lightning: Add support for custom TLV records #111

Closed

Conversation

dennisreimann
Copy link
Member

@dennisreimann dennisreimann commented Dec 10, 2022

Waiting for input for this comment to continue. Looks like it's not doable with CLN 22.11

var tlvData = new Dictionary<ulong,string>
var val696969 = Encoding.Default.GetBytes("123456");
var val112111100 = Encoding.Default.GetBytes("wal_hrDHs0RBEM576");
var tlvData = new Dictionary<ulong, byte[]>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass in the values as byte[] and also get them back as byte[], so that we can support it across implementations.

tests/docker-compose.yml Outdated Show resolved Hide resolved
tests/docker-compose.yml Outdated Show resolved Hide resolved
Comment on lines -383 to -387
var amount = LightMoney.Satoshis(21);
var preimage = new byte[32];
new Random().NextBytes(preimage);
var paymentHash = new uint256(Hashes.SHA256(preimage));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only required for LND, moved it to the LND PayAsync method. The other implementations don't even allow to defined a payment hash for keysend payments.

@@ -8,6 +8,7 @@ namespace BTCPayServer.Lightning
public interface ILightningClient
{
Task<LightningInvoice> GetInvoice(string invoiceId, CancellationToken cancellation = default);
Task<LightningInvoice> GetInvoice(uint256 paymentHash, CancellationToken cancellation = default);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to be able to test the invoice that was generated by a keysend payemnt.

src/BTCPayServer.Lightning.Eclair/EclairLightningClient.cs Outdated Show resolved Hide resolved
src/BTCPayServer.Lightning.Eclair/EclairLightningClient.cs Outdated Show resolved Hide resolved
src/BTCPayServer.Lightning.Eclair/EclairLightningClient.cs Outdated Show resolved Hide resolved
src/BTCPayServer.Lightning.Eclair/EclairLightningClient.cs Outdated Show resolved Hide resolved
@dennisreimann dennisreimann marked this pull request as draft December 10, 2022 08:56
dennisreimann added a commit to dennisreimann/BTCPayServer.Lightning that referenced this pull request Dec 14, 2022
Extracted these from btcpayserver#111:

- Incorporate payment timeout pattern from btcpayserver#106
- Improve failure response
- Fix missing payment info (some [`getsentinfo` properties](https://acinq.github.io/eclair/#getsentinfo) weren't correct)
- Upgrade containers to 0.8.0
@dennisreimann dennisreimann mentioned this pull request Dec 14, 2022
NicolasDorier pushed a commit that referenced this pull request Dec 15, 2022
Extracted these from #111:

- Incorporate payment timeout pattern from #106
- Improve failure response
- Fix missing payment info (some [`getsentinfo` properties](https://acinq.github.io/eclair/#getsentinfo) weren't correct)
- Upgrade containers to 0.8.0
@dennisreimann dennisreimann mentioned this pull request Dec 27, 2022
@dennisreimann dennisreimann force-pushed the keysend-refactoring branch 2 times, most recently from 3648402 to 67c6d97 Compare January 9, 2023 17:10
@dennisreimann dennisreimann changed the title Keysend refactoring Core Lightning: Add support for custom TLV records Jan 12, 2023
@dennisreimann dennisreimann force-pushed the keysend-refactoring branch from 0171a5a to 931a167 Compare May 25, 2023 10:41
- Add GetInvoice by payment hash
- PayResponse: Add payment hash, preimage and status to payment details
- Core Lightning: Add support for custom TLV records
@dennisreimann
Copy link
Member Author

Didn't receive any feedbackl for my questions on the CLN issue. Closing this because Core Lightning doesn't seem to wanna support this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant