0

I have a web3j call to a smart contract ecrecover() function and I need to pass the V value. However I'm unsure as to how to convert the V value to a BigInteger.

Web3j:

aVerifier.verify("Kieran", "Hughes", signature.getV(), signature.getR(), signature.getS()).send();

signature.getV() is not accepted here as it is of the type Byte and must be BigInteger.

Problem solved:

Remix handles basic user input. Web3j requires conversion of Byte to BigInteger

BigInteger.valueOf(signature.getV())
  • Where is your web3 code? – goodvibration Jun 28 '18 at 16:22
  • @goodvibration I've added in the part of the Web3j that I think is causing the problem. When using Remix, I pass the String value output by the println, however in the Web3j call I'm passing just the HexMessage value. – Hughes_J Jun 28 '18 at 16:29
  • @goodvibration turns out I was passing the wrong value of V in my attempt to convert it from Byte to BigInt – Hughes_J Jun 28 '18 at 16:50

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.