Skip to content Skip to footer
Category: Technical

Follow these steps to convert an Ethereum wallet address to its Oasis version programmatically:

Obtain Ethereum Public Key:

Use Ethereum tooling to obtain the public key corresponding to the Ethereum wallet address.

Convert Ethereum Public Key to Oasis Address (Go Example):

Utilize the provided Go code from the Oasis SDK repository to convert the Ethereum public key to an Oasis address.

Example is in Go!

import ("github.com/oasisprotocol/oasis-sdk/client-sdk/go/helpers")

func ethereumToOasisAddress(ethPublicKey []byte) string {oasisAddress := helpers.Bech32Encode("oasis", helpers.HexEncode(ethPublicKey))return oasisAddress}

Implementation in Other Languages:

While the example is in Go, you can adapt the logic to other programming languages, ensuring proper Bech32 encoding and decoding specific to the Oasis Network.

Note: Ensure that you use trusted Ethereum tooling to obtain public keys and follow security best practices. If you have security-related concerns, discuss them with the Oasis Network developers in the dev-central channel on our Discord.