-
Notifications
You must be signed in to change notification settings - Fork 639
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
Standardized NIP-47 metadata for payer/payee in list_transactions
?
#1843
Comments
Hi @danieldaquino yeah I wasn't sure what to put in there exactly either so just left it empty for now. I think you can get zap details for incoming payments from the description field. We're not storing the description for outgoing payments but now I wonder if maybe we should be or else yeah I'm happy to fill in the metadata field with something too. I'll wait to hear from @rolznz on that. If it happens to be a zap between coinos users you could get the bolt11 of the outgoing payment and then call |
@danieldaquino @asoltys we haven't proposed this yet, but in Alby Hub we support setting a Currently we have designed it to support a few open protocols like LNURL (LUD-12 comments and LUD-18 payer data) and NIP-57 (zaps). What do you think?
for outgoing zaps then you would need to set the
|
the way zaps are designed is that the zap request is put as the description hash. on CLN you can recover the description from invoices generated this way, which is what I use in my CLN zapper. I would have assumed other nodes also hold onto the zap request and would include it in the description field, but it seems not? |
@rolznz I like this! It seems like the general approach taken here would be to allocate some top-level metadata keys (e.g. |
@jb55, are you referring to the |
no I am not... I am referring to the description of the zap lightning invoice. lightning invoices have either description or description_hash. zaps use description_hash (technically it also allows description invoices if it fits). When creating a zap invoice the zap request is stored in the description(hash). When creating deschash invoices with CLN the original zap request (description) is still retained on the lightning node side. Zappers then include this in the description tag of the zap. If I was building a NWC implementation I would just include this zap request in the description response on the NWC transaction, but it doesn't look like coinos is doing this. not sure about other implementations it's also confusing to me why we would need a metadata field in this case |
Oh, I see what you mean, @jb55. So in the NIP-47's My concern with this approach would then be that — as you mentioned — the full In those cases where it does not fit, only a To make this work for NWC clients, it seems that it would be necessary to require the inclusion of the
I believe it's partially due to some gaps I had in my understanding of the NIP-47 (NWC) and NIP-57 (Zap) specs until now, and some inconsistencies I found with real data during troubleshooting. From @rolznz's comment, it might be that non-zap transactions can also contain useful receiver/sender data, presumably related to the LUD-12 and LUD-18 specs, but I am not familiar with those at all to know if such information could also be obtained directly from the BOLT-11 invoice itself. I suppose the metadata field would be needed to supplement whatever data is missing from the other fields. |
Actually, I noticed this already seems to be the case with Coinos — at least in some of the cases. @rolznz, can you please confirm if this is already the case for Alby Hub as well?
Sorry, @asoltys, I should have paid more attention to this before — this explains the data I have seen during my testing. I had mostly outgoing payments in my test wallet (thus, empty descriptions), which led me to research into the specification. Would there be any issues/limitations in adding Thank you all for the valuable information and apologize for my confusion! |
@danieldaquino no, we do not return the zap request in the description field (I think only CLN by default supports the behavior @jb55 mentioned above). We cannot rely on the zap request fitting in the description field of the invoice itself. Therefore the payer has to store the zap request alongside the payment. Currently in the NIP-47 spec pay_invoice does not have a way to save arbitrary data. I think adding a |
That's a good point @rolznz, if a client sent a zap using an NWC wallet — and assuming the zap request does not fit in the lightning invoice, there is currently no reliable way that it would be able to find the zap request. sequenceDiagram
participant NWC Provider
participant Client
participant Recipient LNURL server
participant Relays listed on zap request
Client->>Recipient LNURL server: Verify support and recipient info
Recipient LNURL server->>Client: Support and recipient info
Client->>Recipient LNURL server: NIP-57 `kind:9734` zap request
Recipient LNURL server->>Client: Lightning Invoice (description hash only)
Client->>NWC Provider: NIP-47 `pay_invoice` command (Invoice with description hash only)
NWC Provider->>Recipient LNURL server: Pay invoice
Recipient LNURL server->>Relays listed on zap request: NIP-57 `kind:9735` zap receipt (w/ embedded zap request)
Relays listed on zap request->>Client: NIP-57 `kind:9735` zap receipt (w/ embedded zap request)
In that case, it would make sense to add that data to the pay_invoice command as you mentioned, via either:
I am now leaning towards using the metadata field as the primary source of truth for zap request info. The @jb55, thoughts? |
@rolznz, side question, can you please confirm whether Alby Hub already supports this metadata field on the format you specified on pay_invoice and list_invoice? If so, I could implement support for that, and fallback to reading the |
@danieldaquino yes, we support setting |
I think its fine but if they have the data to put it in the metadata then I don't understand why they wouldn't just put it in the description since the same data is the description_hash preimage... but doesn't bother me either way. |
We are implementing a wallet view with a list of transactions from NWC wallets, by using this standard call: https://github.com/nostr-protocol/nips/blob/master/47.md#list_transactions
The
list_transactions
request returns a response in this format:However, I noticed that there does not seem to be a standardized way to communicate information about the sender or receiver of the payment. For example: if it's a zap, it does not indicate the person who was zapped (for outgoing zaps) or the person who sent the zap (for incoming zaps).
The
"metadata"
field indicates it might hold this information, but it does not specify the dictionary keys that would be used for such purposes.Is there currently any standardized way to get that information? Should one be specified in NIP-47?
The text was updated successfully, but these errors were encountered: