[Swift] Get private key in base58-encoding #4076
Unanswered
AlexDarsky
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using walletCore(swift) to signrawtransactionwithkey for siging inputs for raw transaction.But the response always is "Invalid private key".
How do I get the base58 encode string is :
{
let wallet = HDWallet(mnemonic: mnemonic, passphrase: "")
let derivationPath = CoinType.bitcoin.derivationPath()
let privateKey = wallet.getKey(coin: .bitcoin, derivationPath: derivationPath)
let privateKey58 = Base58.encodeNoCheck(data: privateKey.data)
}
Finally, the server replied to my error "Invalid private key"Is it that the steps I used are wrong?
Is there any error in my steps?
Beta Was this translation helpful? Give feedback.
All reactions