commit 35da9e1b235e06e7489e4b69a5c8d058655122c5
parent 603776a1d16d661d4a944f24dba5564c10c4e879
Author: triesap <tyson@radroots.org>
Date: Tue, 28 Jul 2026 23:48:23 +0000
event: use identity-owned public keys
- add direct identity dependencies where SDK boundaries construct event references
- parse fixture authors into canonical PublicKey values at explicit test and smoke boundaries
- migrate knowledge examples and public API coverage to the typed event-reference author
- verify affected SDK packages, binding tests, architecture checks, and formatting
Diffstat:
7 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -2044,6 +2044,7 @@ dependencies = [
"radroots_core",
"radroots_event",
"radroots_event_codec",
+ "radroots_identity",
"serde",
"serde_json",
"wasm-bindgen",
@@ -2394,6 +2395,7 @@ dependencies = [
"radroots_event",
"radroots_event_bindings",
"radroots_event_index",
+ "radroots_identity",
"radroots_identity_bindings",
"radroots_replica_schema_bindings",
"radroots_runtime_contract_v1",
diff --git a/crates/event_codec_wasm/Cargo.toml b/crates/event_codec_wasm/Cargo.toml
@@ -39,3 +39,6 @@ nostr = { workspace = true }
radroots_core = { workspace = true, default-features = false, features = [
"std",
] }
+radroots_identity = { workspace = true, default-features = false, features = [
+ "std",
+] }
diff --git a/crates/event_codec_wasm/src/lib.rs b/crates/event_codec_wasm/src/lib.rs
@@ -969,7 +969,8 @@ mod tests {
fn knowledge_event_ref(seed: char, kind: u32) -> radroots_event::RadrootsEventRef {
radroots_event::RadrootsEventRef {
id: synthetic_event_id(seed),
- author: synthetic_pubkey('a'),
+ author: radroots_identity::PublicKey::from_hex(&synthetic_pubkey('a'))
+ .expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec!["wss://relay.example.test".to_string()]),
diff --git a/crates/sdk/examples/sdk_v1_knowledge_prepare.rs b/crates/sdk/examples/sdk_v1_knowledge_prepare.rs
@@ -1,5 +1,6 @@
use nostr::{EventBuilder, Keys, Kind, Tag, Timestamp};
use radroots_event::RadrootsEventEnvelopeParts;
+use radroots_identity::PublicKey;
use radroots_sdk::knowledge::prelude::*;
const CREATED_AT: u32 = 1_800_000_000;
@@ -70,7 +71,10 @@ fn hex_64(character: char) -> String {
fn event_ref(character: char, kind: u32) -> RadrootsEventRef {
RadrootsEventRef {
id: hex_64(character),
- author: hex_64('a'),
+ author: PublicKey::from_hex(
+ "585591529da0bab31b3b1b1f986611cf5f435dca84f978c89ee8a40cca7103df",
+ )
+ .expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec![RELAY.to_owned()]),
diff --git a/crates/sdk/tests/knowledge_public_api.rs b/crates/sdk/tests/knowledge_public_api.rs
@@ -2,6 +2,7 @@
use nostr::{EventBuilder, Keys, Kind, Tag, Timestamp};
use radroots_event::RadrootsEventEnvelopeParts;
+use radroots_identity::PublicKey;
use radroots_sdk::knowledge::prelude::*;
use std::sync::LazyLock;
@@ -482,7 +483,7 @@ fn hex_64(character: char) -> String {
fn event_ref(character: char, kind: u32) -> RadrootsEventRef {
RadrootsEventRef {
id: hex_64(character),
- author: hex_64('a'),
+ author: PublicKey::from_hex(&public_key_hex()).expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec![RELAY.to_owned()]),
diff --git a/tools/xtask/Cargo.toml b/tools/xtask/Cargo.toml
@@ -20,6 +20,7 @@ radroots_core_bindings = { path = "../../crates/core_bindings", version = "=0.1.
radroots_event = { workspace = true, features = ["dto-bindgen"] }
radroots_event_bindings = { path = "../../crates/event_bindings", version = "=0.1.0-alpha" }
radroots_event_index = { workspace = true, features = ["dto-bindgen"] }
+radroots_identity = { workspace = true }
radroots_identity_bindings = { path = "../../crates/identity_bindings", version = "=0.1.0-alpha" }
radroots_replica_schema_bindings = { path = "../../crates/replica_schema_bindings", version = "=0.1.0-alpha" }
radroots_runtime_contract_v1 = { path = "../../crates/runtime_contract_v1", version = "=0.1.0-alpha" }
diff --git a/tools/xtask/src/smoke.rs b/tools/xtask/src/smoke.rs
@@ -178,7 +178,10 @@ fn hex_64(character: char) -> String {
fn event_ref(character: char, kind: u32) -> RadrootsEventRef {
RadrootsEventRef {
id: hex_64(character),
- author: hex_64('a'),
+ author: radroots_identity::PublicKey::from_hex(
+ "585591529da0bab31b3b1b1f986611cf5f435dca84f978c89ee8a40cca7103df",
+ )
+ .expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec!["wss://relay.radroots.example".to_owned()]),