Me trying to grasp BIP39 with PowerShell.

```

function GenerateBIP39SeedPhrase {

# Generate $words random indices between 0 and 2047

$indices = 1..$words | ForEach-Object { Get-Random -Minimum 0 -Maximum 2048 }

# Select words from the BIP-39 word list based on the generated indices

$seedPhrase = $indices | ForEach-Object { $wordList[$_] }

# Join the words with a space separator

$seedPhrase -join " "

}

# Reading BIP39 wordlist from Hashicorp Vault

$r2 = VaultApi Kv1Read kv1/File/BIP39list -Raw -kvkey wordlist

$wordList = $r2.Split(" ")

# Generate a BIP-39 seed phrase

$seedPhrase = GenerateBIP39SeedPhrase

Write-Output $seedPhrase

```

Reply to this note

Please Login to reply.

Discussion

No replies yet.