Skip to content

Conversation

jpgundrum
Copy link

@jpgundrum jpgundrum commented Apr 4, 2025

Similar functionality to the evmToAddress function in ts - but for python.

How to use:

    evm_address = "0x3e3FF16083Bf0a444B8fF86C7156eB3368e3cefB"
    ss58_format = 42
    ss58_address = evm_to_address(evm_address, ss58_format)
    print(f"SS58 Address: {ss58_address}")

Can see the evm address in the Explorer. After clicking on the View Substrate Data button you will see how the Substrate Address matches the one outputted from the code example above.

Please double check for faulty logic and confirm with tests on your side. Not sure if there is a python implementation for this anywhere... if there is please make it public so it is easier to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant