InvalidPathException

class InvalidPathException(val path: String, message: String = "Invalid BIP-32 derivation path: ") : Sep05Exception

Exception thrown when a BIP-32 derivation path is invalid.

SEP-5 uses BIP-32 hierarchical deterministic key derivation with SLIP-10. The standard Stellar path is "m/44'/148'/0'" where:

  • m: master node

  • 44': BIP-44 purpose (hardened)

  • 148': Stellar coin type (hardened)

  • 0': account index (hardened)

Valid path format:

  • Must start with "m/"

  • Path components separated by "/"

  • Each component is a 31-bit unsigned integer (0 to 2147483647)

  • Hardened derivation indicated by "'" or "h" suffix

  • For Stellar, all derivation should be hardened

Common causes:

  • Missing "m/" prefix

  • Invalid characters in path

  • Index out of valid range

  • Empty path components

Example:

try {
val keypair = wallet.deriveKeyPair("invalid/path")
} catch (e: InvalidPathException) {
println("Invalid path: ${e.path}")
println("Error: ${e.message}")
println("Use format: m/44'/148'/0'")
}

See also:

Parameters

message

Description of the path validation failure

Constructors

Link copied to clipboard
constructor(path: String, message: String = "Invalid BIP-32 derivation path: ")

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?
Link copied to clipboard

The invalid derivation path

Functions

Link copied to clipboard
open override fun toString(): String