If I'm to push a transaction without using eosjs / cleos, and straight into nodeos, how would I sign a transaction? This is assuming I have the private key in memory somewhere, ready to sign things

up vote 1 down vote accepted

Signing a transaction involves first packing the transaction along with the chainID and Context Free Data, then digitally signing it with the user's private key. However, the process for doing this is very particular (I just spent 2 weeks figuring out all the details).

I have a Java EOS RPC project that I wrote for work on GitHub. You can checkout the signing code in the JavaWallet class.

  • Sweet, thanks, will check it out. Did you reverse engineer from EOSJS? I also cannot, for the life of me, find what "context free data" means - is it just a specific set of data (action data, recipient, etc) collated into one string? – kamziro Aug 9 at 8:19
  • I reverse engineered it primarily from the Wallet Plugin code in EOS. The hardest part was dealing with the HmacDSAKCalculator and figuring out exactly what the EOS code was doing that the Java/BouncyCastle code wasn't. As for Context Free Data, I have no idea. I don't know what Context Free Actions are either, which is why they are left basically unimplemented in the library. – John Haager Aug 9 at 22:19
  • Ah yeah, I got the serialization bit working - except for the action data - I actually looked it up from the code you wrote. Are you relying on abi_json_to_bin from nodeos? Apparently it's open to MITM attack – kamziro Aug 10 at 12:11
  • @kamziro It does rely on the abi_json_to_bin call. Hadn't seen the news about its MITM attack. Will have to make another pass through the code and check on that. – John Haager Aug 14 at 19:52
  • Basically, what I was told is that if you pass abi_json_to_bin and they give a bad binarization (e.g transfer to someone else instead of your intended recipient) and then you sign it blindly if you don't know what the exact binarization is supposed to look like. Did you also do the signing bit (width ECDSA) in your wallet? – kamziro Aug 15 at 1:38

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.