bolts icon indicating copy to clipboard operation
bolts copied to clipboard

Add MIME type recommendation to BOLT-11

Open icota opened this issue 6 years ago • 9 comments

Not using 'application/x-lightning' because x-prefixes are strongly discouraged as per IETF's RFC 6838: https://tools.ietf.org/html/rfc6838

icota avatar Apr 06 '18 05:04 icota

Thoughts on application/lightning-invoice or application/ln-invoice? application/lightning doesn't feel specific enough. For example, maybe there will be a reason to transport raw LN messages like node_announcements or channel_announcements in a context that requires a MIME type.

jimpo avatar Apr 16 '18 19:04 jimpo

@jimpo You are absolutely right. I prefer application/lightning-invoice as it's more consistent with the chosen URI scheme.

icota avatar Apr 16 '18 19:04 icota

What's the precise use case for this?

Roasbeef avatar Apr 16 '18 20:04 Roasbeef

@Roasbeef LN wallet apps may register themselves as handlers for our MIME type with the OS. When you tap your phone on an NFC payment terminal and data with a MIME type of application/lightning-invoice is read Android knows to wake up and forward that (BOLT-11) data to whatever app handles lightning. It's also useful for sharing via bluetooth, email, you name it

icota avatar Apr 16 '18 20:04 icota

In that scenario, why would BOLT-11 even be used? As is, the format is meant to be human readable to a degree. When accepting information over NFC, it seems one would just use a custom file format? (which would be another BOLT all together)

Roasbeef avatar Apr 30 '18 20:04 Roasbeef

Personally I wouldn't go reinventing the wheel for NFC just because a tiny bit is human readable. BOLT-11 works and we are already encoding it to QR codes which are definitely not human readable. NFC or bluetooth or whatever is just another medium. We already have a URI scheme why not a MIME type too?

icota avatar Apr 30 '18 20:04 icota

You can't just self-assign MIME types. There's actually a process for this; and you refer to the document which tells you that.

The only no-registered name I can see would be prs.lightning-invoice which would be a personal/experimental name. Yech...

rustyrussell avatar May 24 '18 04:05 rustyrussell

What happened with this proposal? Was a MIME type added?

philipt18 avatar Oct 16 '19 07:10 philipt18

Not that I know of.

icota avatar Oct 18 '19 12:10 icota