Skip to content

Conversation

@ovitrif
Copy link

@ovitrif ovitrif commented Jan 11, 2026

Integrated in:

This PR exposes a new utility function derive_node_secret_from_mnemonic that derives the node secret key from a BIP39 mnemonic phrase.

Changes

  • Added derive_node_secret_from_mnemonic(mnemonic, passphrase) function
  • Added InvalidMnemonic error variant
  • Exposed the new function in the UniFFI bindings for Kotlin, Swift, and Python
  • Bumped version to 0.7.0-rc.3

Usage

This function returns the same secret key that would be used by a Node built with the mnemonic via Builder::set_entropy_bip39_mnemonic. This is useful for applications that need access to the node secret without instantiating a full node.

let secret = derive_node_secret_from_mnemonic(
    "abandon abandon abandon...".to_string(),
    Some("optional passphrase".to_string()),
)?;

QA Notes

Testing

  • cargo test passes
  • cargo clippy clean
  • Android bindings: ./scripts/uniffi_bindgen_generate_kotlin_android.sh
  • iOS bindings: ./scripts/uniffi_bindgen_generate_swift.sh

Release: v0.7.0-rc.3

Add a new public function to derive the node secret key from a BIP39
mnemonic without requiring a running Node instance. This enables backup
authentication before the node starts.
@ovitrif ovitrif changed the title feat: expose derive_node_secret_from_mnemonic feat: expose derive_node_secret_from_mnemonic Jan 11, 2026
@ovitrif ovitrif self-assigned this Jan 11, 2026
@ovitrif ovitrif marked this pull request as ready for review January 11, 2026 22:39
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.

2 participants