bitcoinjs / bolt11

A library for encoding and decoding lightning network payment requests as defined in BOLT #11.
MIT License
93 stars 65 forks source link

Tag names matching bolt11 rfc spec #7

Closed juscamarena closed 5 years ago

juscamarena commented 5 years ago

expire_time is used instead of expiry. Seems some small modifications to other tags as well. Any reason they don't follow the tags named here: https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md

I'd be happy to change them to match.

Also, it'd probably be a bit confusing for new users to not see timeExpireDateString if the invoice doesn't have and expiry, (default implying 3600) would if be okay if I made a pull req so that decode returns expiry with timestamp + implied default when no expiry tag is present?

junderw commented 5 years ago

tag name changes

No. I don't think these names must be the same. Changing them will break apps depending on the current names.

decode returns expiry with timestamp + implied default when no expiry tag is present?

No. The assumption is payreq === encode(decode(payreq)).paymentRequest but if you add info to a decoded payreq that would break the signature. (encode would try to re-encode, verify the signature, and see the extra expiry tag and throw an error.

Thanks, if you see any other things I'd appreciate feedback.