Skip to content

fix(deps): migrate nostr crate from 0.36 to 0.44#708

Merged
wpfleger96 merged 10 commits into
mainfrom
fix/nostr-044
May 22, 2026
Merged

fix(deps): migrate nostr crate from 0.36 to 0.44#708
wpfleger96 merged 10 commits into
mainfrom
fix/nostr-044

Conversation

@wpfleger96
Copy link
Copy Markdown
Collaborator

@wpfleger96 wpfleger96 commented May 21, 2026

Summary

Breaking changes addressed

  • EventBuilder::new — migrated from 3-arg (kind, content, tags) to builder pattern .new(kind, content).tags(tags) across 222 call sites in 55 files
  • Tag::parse — removed reference on slice argument (&[...][...]) across 304 call sites in 42 files
  • generate_shared_key — now returns Result, added error handling at 9 call sites
  • PublicKey::serialize() — removed, replaced with .to_bytes() / .as_bytes() at 55 call sites in 15 files
  • nostr::bitcoin::* re-exports — removed, switched to nostr::secp256k1::* and nostr::hashes::*
  • nostr::util::hex — removed, switched to hex crate directly (added hex dep to sprout-proxy)
  • RelayMessage / ClientMessage — gained lifetime parameters, adapted proxy code to carry raw JSON strings instead of borrowing
  • EventBuilder::auth — now takes RelayUrl instead of url::Url
  • Filter::custom_tag — changed to single-value; switched to custom_tags() for multi-value
  • nip44 / nip98 — features no longer default, now explicit in workspace Cargo.toml
  • nostr-compat — removed entirely from desktop/src-tauri/Cargo.toml since both versions are now 0.44; migrated all nostr_compat:: references to nostr::
  • Timestamp::as_u64() — deprecated in favor of as_secs(), updated in key call sites (some deprecation warnings remain)

@wpfleger96 wpfleger96 requested a review from a team as a code owner May 21, 2026 21:01
@wpfleger96 wpfleger96 force-pushed the fix/nostr-044 branch 2 times, most recently from b1cc86f to 2e3000e Compare May 22, 2026 19:19
wpfleger96 added 10 commits May 22, 2026 17:02
Breaking changes addressed:
- EventBuilder::new switched from 3-arg to builder pattern (.tags())
- Tag::parse no longer takes a reference (&[...] → [...])
- generate_shared_key returns Result — added ? / .map_err / .unwrap()
- nip44 and nip98 features must now be explicit
- PublicKey.serialize() renamed to .to_bytes()/.as_bytes()
- nostr::bitcoin::* re-exports removed — now nostr::secp256k1::* and nostr::hashes::*
- RelayMessage and ClientMessage gained lifetime parameters
- UncheckedUrl removed — replaced by Url/RelayUrl
- EventBuilder::auth now requires RelayUrl not url::Url
- Filter::custom_tag takes a single S: Into<String>; use custom_tags for slices
- ConversationKey::derive and Timestamp::as_u64 now deprecated/return Result
- nostr::util::hex removed — use hex crate directly
- nostr-compat alias removed from desktop (now same version as nostr)
- Fix EventBuilder::auth to use RelayUrl instead of Url (3 sites)
- Fix custom_tag → custom_tags for array arguments (2 sites)
- Fix cargo fmt violations from mechanical replacement
- Replace deprecated Timestamp::as_u64() with as_secs() (8 sites)
- Remove stale Compat* type aliases from identity.rs
- Remove redundant use nostr statement from agents.rs
The previous commit ran cargo fmt at the root workspace but missed the
desktop/src-tauri workspace which has its own Cargo.toml.
Remove unused XOnlyPublicKey import, explicit auto-deref on raw_key,
and needless borrow on SECP256K1 constant.
- Replace deprecated Timestamp::as_u64() with as_secs() across all crates
- Remove unused Url imports in sprout-mcp and sprout-acp
- Fix Tag::parse trait bound error in sprout-acp test
- Fix XOnlyPublicKey usage in git-sign-nostr test code
Same Timestamp::as_u64() → as_secs() migration as the root workspace,
applied to the desktop/src-tauri crate which has its own Cargo.toml.
PR #719 (NIP-23 long-form notes) merged to main with pre-0.44 API
calls. Apply the same EventBuilder and Tag::parse migrations.

Also fix matching dms.rs breakage (same Tag::parse/EventBuilder::new
pattern) that blocked compilation, and replace the deprecated
Timestamp::as_u64() with as_secs() in notes.rs.
PR #719 E2E test file and notes.rs test code still used deprecated
Timestamp::as_u64(), old Tag::parse(&[]) signature, 3-arg
EventBuilder::new(), and array-form custom_tag().
PR #726 introduced new code using old nostr 0.36 patterns:
- EventBuilder::new() 3-arg form → 2-arg + .tags()
- PublicKey::serialize() → .to_bytes()
- Tag::parse(&[...]) → Tag::parse([...]) in e2e_git tests
@wpfleger96 wpfleger96 merged commit a65b7fc into main May 22, 2026
15 checks passed
@wpfleger96 wpfleger96 deleted the fix/nostr-044 branch May 22, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant