ln-paywall v0.5.0 Release Notes

Release Date: 2018-09-23 // over 5 years ago
    • โž• Added: Support for c-lightning with Lightning Charge (issue #6)
      • Note: The current implementation's performance decreases with the amount of invoices in the Lightning Charge server. This will be fixed in an upcoming release.
    • โž• Added: Package pay (issue #20)
      • Interface pay.LNclient - Abstraction of a Lightning Network node client for paying LN invoices. Enables developers to write their own implementations if the provided ones aren't enough.
      • Struct pay.Client - Replacement for a standard Go http.Client
      • Factory function NewClient(httpClient *http.Client, lnClient LNclient) Client - httpClient can be passed as nil, leading to http.DefaultClient being used
      • Method Do(req *http.Request) (*http.Response, error) - Meant to be used as equivalent to the same Go http.Client method, but handles the Lightning Network payment in the background.
      • Method Get(url string) (*http.Response, error) - A convenience method for the Do(...) method, also an equivalent to the same Go http.Client method (regarding its usage)

      - Example client in examples/client/main.go

    ๐Ÿ‘ > Note: Currently only ln.LNDclient can be used in the client, because Lightning Charge doesn't support sending payments (and maybe never will)

    • โž• Added: Method Pay(invoice string) (string, error) for ln.LNDclient - Implements the new pay.LNclient interface, so that the LNDclient can be used as parameter in the pay.NewClient(...) function. (Issue #20)
    • ๐Ÿ›  Fixed: A client could cheat in multiple ways, for example use a preimage for a request to endpoint A while the invoice was for endpoint B, with B being cheaper than A. Or if the LN node is used for other purposes as well, a client could send any preimage that might be for a totally different invoice, not related to the API at all. (Issue #16)
    • ๐Ÿ›  Fixed: Some info logs were logged to stderr instead of stdout

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿ”„ Changed: The preimage in the X-Preimage header must now be hex encoded instead of Base64 encoded. The hex encoded representation is the typical representation, as used by "lncli listpayments", Eclair on Android and bolt11 payment request decoders like https://lndecode.com. Base64 was used previously because "lncli listinvoices" uses that encoding. (Issue #8)
    • ๐Ÿ”„ Changed: Interface wall.StorageClient and thus all its implementations in the storage package were significantly changed. The methods are now completely independent of any ln-paywall specifics, with Set(...) and Get(...) just setting and retrieving any arbitrary interface{} to/from the storage. (Required for issue #16.)
    • ๐Ÿ”„ Changed: The method GenerateInvoice(int64, string) (string, error) in the interface wall.LNclient was changed to return a ln.Invoice object, which makes it much easier to access the invoice ID (a.k.a. preimage hash, a.k.a. payment hash), instead of having to decode the invoice. (Useful for issue #16, in which the invoice ID is required as key in the storage.)