You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I need to get exact hex for a string...what I have tried
let mnemonic = "xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx"
let seed = Mnemonic.createSeed(mnemonic: mnemonic)
let purpose1 = PrivateKey.init(seed: seed, coin: .bitcoin)
let purpose = purpose1.derived(at: .hardened(44))
//Bitcoin
let coinType = purpose.derived(at: .hardened(0))
// m/44'/0'/0'
let account = coinType.derived(at: .hardened(0))
// m/44'/0'/0'/0
let change = account.derived(at: .notHardened(0))
// m/44'/0'/0'/0/0
let firstPrivateKey = change.derived(at: .notHardened(0))
let sign = "1dca0a148623f3f5ce5f49b2abc34384403e545620dca69ceb59da246951b4c3"
let data = Data.init(hex: sign)
let signatureData = try! firstPrivateKey.sign(hash: data)
print(signatureData.hex)
It gives me wrong hex and Error reading signaturesalid signature, wrong length.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: