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.
EOS.IO Stack Exchange is a question and answer site for users and developers of distributed applications built on top of the blockchain operating system, EOS.IO. It only takes a minute to sign up.
Sign up to join this communityRefer 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.
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
Jun 16, 2021 at 7:40
if you want to see how signing is done in eosio these can be two starting points (none of them are python samples):
for a python sample try this: https://github.com/eosnewyork/eospy/blob/ed55d652f5dcc9e45917273e6bc14b37791e772d/eospy/keys.py#L163