0

I am trying to implement signing in python, but I can't really find any example of signing data (e.g. SIG_1_...) anywhere. ANyone has links to examples?

Basically, I want to sign it 'manually', using python, not cleos and etc.

2 Answers 2

1

Refer to eospy.

EOSIO also uses secp256k1 like Bitcoin or Ethereum, so you can sign a transaction manually, but you should know its encoding convention. Its signature consists of SIG_K1_ prefix and WIF-encoded BASE58 string. Unlike Bitcoin or Ethereum, EOSIO demands a canonical signature, which is more restrict than low-s signature.

4
  • Unfortunately, eospy doesn't help me. Signatures, that it provides, don't work for WAX network: for some reason it's longer, then the signature, needed in WAX, so WAX node API returns an error. I was trying to use only first 65 bytes of signature it provides, but it didn't work out neither
    – Apepenkov
    Jun 16, 2021 at 7:35
  • I was also trying to use ecdsa module, and make signature, by signing SHA-256'ed data by it (using ecdsa.SigningKey.from_string(WIF, ecdsa.SECP256k1, hashlib.sha256), But it didn't work niether
    – Apepenkov
    Jun 16, 2021 at 7:40
  • waxjs uses eosjs directly for signing a transaction. I don't think there is a significant difference between eos and wax. You should distinguish 65 bytes signature binary from its encoded (stringified) form.
    – conr2d
    Jun 16, 2021 at 8:58
  • you can try to ask the same question on the telegram eosio devs channel: t.me/joinchat/0uhWYfXVpPlkNTA1
    – ovi
    Jun 25, 2021 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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