|
Radix Relay
Hybrid mesh communications with Signal Protocol encryption
|
Nostr event data structure. More...
#include <protocol.hpp>
Public Member Functions | |
| auto | serialize () const -> std::vector< std::byte > |
| Serializes event data to byte array. | |
| auto | is_radix_message () const -> bool |
| Checks if event is a Radix-specific message type. | |
| auto | get_kind () const -> std::optional< enum kind > |
| Returns the event kind. | |
Static Public Member Functions | |
| static auto | deserialize (std::span< const std::byte > bytes) -> std::optional< event_data > |
| Deserializes event data from byte array. | |
| static auto | deserialize (const std::string &json) -> std::optional< event_data > |
| Deserializes event data from JSON string. | |
| static auto | create_identity_announcement (const std::string &sender_pubkey, std::uint64_t timestamp, const std::string &signal_fingerprint, const std::string &capabilities="mesh,nostr") -> event_data |
| Creates an identity announcement event. | |
| static auto | create_bundle_announcement (const std::string &sender_pubkey, std::uint64_t timestamp, const std::string &bundle_hex) -> event_data |
| Creates a bundle announcement event. | |
| static auto | create_encrypted_message (std::uint64_t timestamp, const std::string &recipient_pubkey, const std::string &encrypted_payload) -> event_data |
| Creates an encrypted message event. | |
| static auto | create_session_request (const std::string &sender_pubkey, std::uint64_t timestamp, const std::string &recipient_pubkey, const std::string &prekey_bundle) -> event_data |
| Creates a session establishment request event. | |
Public Attributes | |
| std::string | id |
| Event ID (32-byte hex hash) | |
| std::string | pubkey |
| Public key of event creator (32-byte hex) | |
| std::uint64_t | created_at {} |
| Unix timestamp. | |
| std::vector< std::vector< std::string > > | tags |
| Event tags (arbitrary string arrays) | |
| std::string | content |
| Event content. | |
| std::string | sig |
| Schnorr signature (64-byte hex) | |
Nostr event data structure.
Represents a complete Nostr event with all required fields per NIP-01.
Definition at line 43 of file protocol.hpp.
|
static |
Creates a bundle announcement event.
| sender_pubkey | Nostr public key of sender |
| timestamp | Unix timestamp |
| bundle_hex | Hex-encoded prekey bundle |
|
static |
Creates an encrypted message event.
| timestamp | Unix timestamp |
| recipient_pubkey | Nostr public key of recipient |
| encrypted_payload | Encrypted message content |
|
static |
Creates an identity announcement event.
| sender_pubkey | Nostr public key of sender |
| timestamp | Unix timestamp |
| signal_fingerprint | RDX fingerprint |
| capabilities | Comma-separated capability list |
|
static |
Creates a session establishment request event.
| sender_pubkey | Nostr public key of sender |
| timestamp | Unix timestamp |
| recipient_pubkey | Nostr public key of recipient |
| prekey_bundle | Prekey bundle data |
|
static |
Deserializes event data from JSON string.
| json | JSON string |
|
static |
Deserializes event data from byte array.
| bytes | Raw bytes containing JSON event data |
| auto radix_relay::nostr::protocol::event_data::get_kind | ( | ) | const -> std::optional< enum kind > |
Returns the event kind.
| auto radix_relay::nostr::protocol::event_data::is_radix_message | ( | ) | const -> bool |
Checks if event is a Radix-specific message type.
| auto radix_relay::nostr::protocol::event_data::serialize | ( | ) | const -> std::vector< std::byte > |
Serializes event data to byte array.
| std::string radix_relay::nostr::protocol::event_data::content |
Event content.
Definition at line 50 of file protocol.hpp.
Referenced by radix_relay::nostr::message_handler< Bridge >::handle(), radix_relay::nostr::message_handler< Bridge >::handle(), and radix_relay::nostr::message_handler< Bridge >::handle().
| std::uint64_t radix_relay::nostr::protocol::event_data::created_at {} |
Unix timestamp.
Definition at line 47 of file protocol.hpp.
Referenced by radix_relay::nostr::message_handler< Bridge >::handle(), radix_relay::nostr::message_handler< Bridge >::handle(), and radix_relay::nostr::message_handler< Bridge >::handle().
| std::string radix_relay::nostr::protocol::event_data::id |
Event ID (32-byte hex hash)
Definition at line 45 of file protocol.hpp.
Referenced by radix_relay::nostr::message_handler< Bridge >::handle(), radix_relay::nostr::message_handler< Bridge >::handle(), and radix_relay::nostr::message_handler< Bridge >::handle().
| std::string radix_relay::nostr::protocol::event_data::pubkey |
Public key of event creator (32-byte hex)
Definition at line 46 of file protocol.hpp.
Referenced by radix_relay::nostr::message_handler< Bridge >::handle(), radix_relay::nostr::message_handler< Bridge >::handle(), and radix_relay::nostr::message_handler< Bridge >::handle().
| std::string radix_relay::nostr::protocol::event_data::sig |
Schnorr signature (64-byte hex)
Definition at line 51 of file protocol.hpp.
Referenced by radix_relay::nostr::message_handler< Bridge >::handle(), radix_relay::nostr::message_handler< Bridge >::handle(), and radix_relay::nostr::message_handler< Bridge >::handle().
| std::vector<std::vector<std::string> > radix_relay::nostr::protocol::event_data::tags |
Event tags (arbitrary string arrays)
Definition at line 49 of file protocol.hpp.
Referenced by radix_relay::nostr::message_handler< Bridge >::handle(), radix_relay::nostr::message_handler< Bridge >::handle(), and radix_relay::nostr::message_handler< Bridge >::handle().