Expose author pubkey from e-tag parsing in NoteIdRef
Description:
When parsing NIP-10 e-tags, NoteIdRef currently exposes:
- id - event ID
- relay - relay hint
- marker - root/reply/mention
Per [NIP-10](https://github.com/nostr-protocol/nips/blob/master/10.md), the full e-tag format includes an optional 5th element for the referenced event's author pubkey:
["e", <event-id>, <relay-url>, <marker>, <pubkey>]
### Current behavior:
``` NoteReply::root() ```and ```NoteReply::reply() ```return NoteIdRef without access to the pubkey, even when it exists in the original tag.
### Requested behavior:
Add an optional pubkey field to NoteIdRef:
```
pub struct NoteIdRef<'a> {
pub index: u16,
pub id: &'a [u8; 32],
pub relay: Option<&'a str>,
pub marker: Option<&'a str>,
pub pubkey: Option<&'a [u8; 32]>, // NEW
}
```
Use case:
When creating reply notes, clients should preserve the root author pubkey if it was present in the original thread. Currently notedeck cannot do this because NoteIdRef doesn't expose it.
```
// Current: cannot include root author pubkey
["e", "<root-id>", "<relay>", "root"]
// Desired per NIP-10:
["e", "<root-id>", "<relay>", "root", "<root-author-pubkey>"]
```
Reference:
- NIP-10: https://github.com/nostr-protocol/nips/blob/master/10.md
- notedeck relay hints PR: pending
---
1 条评论