feat: simple poc

This commit is contained in:
2025-12-16 09:18:23 +07:00
parent 15cefbd84f
commit 0be73e8e82
8 changed files with 239 additions and 24 deletions

View File

@@ -1,5 +1,7 @@
pub use constants::*;
pub use paths::*;
pub use utils::*;
mod constants;
mod paths;
mod utils;

View File

@@ -0,0 +1,11 @@
use nostr_sdk::prelude::*;
pub fn shorten_pubkey(public_key: PublicKey, len: usize) -> String {
let Ok(pubkey) = public_key.to_bech32();
format!(
"{}:{}",
&pubkey[0..(len + 1)],
&pubkey[pubkey.len() - len..]
)
}