2

I use conseiljs. I am trying it on Babylonnet. When I create fresh wallet with createAccount() method everything works (https://cryptonomic.github.io/ConseilJS/#/?id=create-an-empty-tezos-account) But when I create HD wallets, and try to send transaction with HD wallet it gives error.

First I create HD wallet:

const { derivePath } = require('ed25519-hd-key')
const bs58check = require('bs58check')
const secretPrefix = new Uint8Array([43, 246, 78, 7])

function bs58checkEncode(input, prefix_info) {
  const prefix_bytes = typeof prefix_info === 'string' ? prefix[prefix_info] : prefix_info
  return bs58check.encode(Buffer.from(bytesConcat(prefix_bytes, input)))
}

// derivePath(path, seed)
const { key } = derivePath(m/44'/1729'/5', fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542);
const secret = bs58checkEncode(key.toString('hex'), secretPrefix)
// console.log(secret) -> edskRc1n1hXrjs3pFeLLqPUHAeVr74DyswvvqJSbAan7rPwqbNjqaYicFrq53A7u21R1EGkDvCSPmz8JYvVN9TcFhoes2AnWtA
const keystore = await conseiljs.TezosWalletUtil.restoreIdentityWithSecretKey(secret)

After these steps, I have the keystore:

{ publicKey: 'edpkuZywVJC3eYPWncjpQg3wVFPkP9FdDoF3HM3tZhwLEgJAUwhtT9',
  privateKey:
   'edskRc1n1hXrjs3pFeLLqPUHAeVr74DyswvvqJSbAan7rPwqbNjqaYicFrq53A7u21R1EGkDvCSPmz8JYvVN9TcFhoes2AnWtA',
  publicKeyHash: 'tz1ZsfUetcKsGU2L9cZb6nfDuN3ZKtdSN1DA',
  seed: '',
  storeType: 0 }

After sending some tezos to my wallet (tz1ZsfUetcKsGU2L9cZb6nfDuN3ZKtdSN1DA) I am trying to send a transaction:

const averageFee = (await utils.averageFees())[0][medium]
const result = await conseiljs.TezosNodeWriter.sendTransactionOperation(env.node, keystore, to, 500000, Number(averageFee));

Error message:

{
   "kind": "temporary",
   "id": "failure",
   "msg": "Error while applying operation ooiTkzxquPw9hJ3pjui4jEJHK7a7ez3mV4c9wg8rHcmDyUUwjH7:\nrefused (Error:\n           The operation signature is invalid\n)"
}

It says "The operation signature is invalid" but everything seems true. Why it thinks my keystore is wrong?

1
  • Were you able to find a solution for this? – coder123 Jun 1 '20 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.