Ethereumj gives a lot of byte arrays, when the equivalent would be a string in Bitcoin. A few examples (in Scala)

ECKey.getAddress // returns Array[Byte], need String

Transaction.getHash // returns Array[Byte], need String

Transaction.getNonce // returns Array[Byte], need Int (or BigInteger)

Are the Strings supposed to be Hex encoded byte arrays? So, for example, I would do:

val addr = Hex.encodeBytes(ECKey.getAddress)

val txHash = Hex.encodeBytes(Transaction.getHash) 

val txNonce = new BigInteger(Transaction.getNonce)

Which of the above are right?

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.