Skip to content

Instantly share code, notes, and snippets.

@rllola
Created August 13, 2024 14:57
Show Gist options
  • Save rllola/c7a842cae74474854eaca2b3d06ab275 to your computer and use it in GitHub Desktop.
Save rllola/c7a842cae74474854eaca2b3d06ab275 to your computer and use it in GitHub Desktop.
from ecdsa import VerifyingKey
import ecdsa
# tx : https://sepolia.etherscan.io/getRawTx?tx=0x39adc69ce44b1cd82df7d024d59793cf774c2902c8894b01979d0976b420aa38
digest = bytearray.fromhex("365e8c124f9899fa9fe3f5d0b49f8c672b852340f32c1f4762cc02499b1e9cd5")
sig = bytearray.fromhex("00000000000000000000000000000000000000000000000000000005ca1ab1e0000000000000000000000000000000000000000000000000000000005ca1ab1e")
pubkeys = VerifyingKey.from_public_key_recovery_with_digest(sig, digest, ecdsa.SECP256k1, hashfunc=None)
# We should fin 0438df74e6944be4c15fe5396e7f8d317c41d512a0bc78ec1dbe9505da97b08c74aa80b5796d569395a4caf80f661a4f82a51c2b8d25df0953c882a777ea2e332c
for pub in pubkeys:
print(pub.to_string("uncompressed").hex())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment