Skip to content

Expose author pubkey from e-tag parsing in NoteIdRef (NIP-10) #113

@alltheseas

Description

@alltheseas

Description:

When parsing NIP-10 e-tags, NoteIdRef currently exposes:

  • id - event ID
  • relay - relay hint
  • marker - root/reply/mention

Per NIP-10, the full e-tag format includes an optional 5th element for the referenced event's author pubkey:
["e", , , , ]

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:


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions