Skip to main content

Ethereum API

A set of methods for obtaining public keys, signing messages, and transactions specific to the Ethereum network and protocols based.

Networks

NetworkSymbolIDChainDescription
EthereumETH11The Ethereum mainnet is the primary blockchain network for executing smart contracts and decentralized applications (DApps) on the Ethereum platform.
GoerlitETH25Goerli is an Ethereum testnet that utilizes the proof-of-authority consensus, designed for testing and ensuring compatibility across various Ethereum clients.
PolygonMATIC3137Polygon is a layer 2 scaling solution for Ethereum, providing a framework for building and connecting multiple blockchains to enhance scalability and reduce transaction fees on the Ethereum network.
OptimismETH410Optimism is a layer 2 scaling solution for Ethereum that aims to improve scalability and reduce transaction costs by implementing optimistic rollups, a technology designed to increase the throughput of the Ethereum blockchain.
ArbitrumETH542161Arbitrum is a layer 2 scaling solution for Ethereum, utilizing optimistic rollups to enhance scalability and reduce transaction fees by processing most transactions off-chain while leveraging the security of the Ethereum mainnet.
BNB ChainBNB656Binance Smart Chain (BSC) is a blockchain network developed by Binance that runs in parallel with Binance Chain, providing smart contract functionality, faster transaction confirmation times, and lower fees, making it an alternative for decentralized applications (DApps) and decentralized finance (DeFi) activities.
Avalanche (C-Chain)AVAX743114Avalanche C-Chain, also known as the Avalanche Contract Chain, is a component of the Avalanche network. Avalanche is a decentralized platform that aims to provide scalable and highly customizable blockchain networks. The C-Chain specifically focuses on smart contracts, enabling developers to create and deploy decentralized applications (DApps) with a high level of customization, scalability, and interoperability.
WB NetworkWBT81875WB Network operates on a Proof-of-Authority (PoA) consensus mechanism, leveraging trusted validators to secure the blockchain and ensure efficient and reliable transaction processing.
BaseETH98453Base is powered by Optimism's OP Stack, making it one of the most secure, scalable EVM L2s out there. The OP Stack is an open-source public good that will serve as the foundation for a “superchain” of L2s that share interoperability, sequencing, and governance.
SepoliatETH1011155111Sepolia is an Ethereum testnet that utilizes the proof-of-authority consensus, designed for testing and ensuring compatibility across various Ethereum clients.

Methods

GET_PUBLIC_KEY

Returns an HD node corresponding to the specified BIP32 path.

Request

ethereum.proto
message GetPublicKey {
uint32 network = 1;
Bip32Path path = 2;
}
  • network: Network identifier, see NETWORKS
  • path: BIP32 path of the key to obtain the HD node.

Response

ethereum.proto
message GetPublicKeyResult {
uint32 depth = 1;
uint32 index = 2;
bytes publicKey = 3;
bytes chainCode = 4;
uint32 fingerprint = 5;
}

SIGN_PERSONAL_MESSAGE

The EIP-191 signing function creates a signature by combining a prefix (or salt) with the actual message, forming data that is then signed with a private key. This enhances security by preventing signature reuse and standardizes the process across the Ethereum network.

Request

ethereum.proto
message SignPersonalMessage {
uint32 network = 1;
Bip32Path path = 2;
bytes msg = 3;
}
  • network: Network identifier, see NETWORKS
  • path: BIP32 path of the key for signing the message
  • msg: Message to be signed.

Response

ethereum.proto
message ECDSASignResult {
uint32 v = 1;
bytes r = 2;
bytes s = 3;
}
  • v, r, s:: component of the ECDSA signature.

SIGN_EIP712_MESSAGE

EIP-712 introduces a standardized method for hashing and signing structured data in Ethereum. This helps improve security and readability in message signing for decentralized applications (DApps) and smart contracts. The typed data domain separator reduces errors and provides a clear format for secure off-chain message verification with Ethereum addresses.

Request

ethereum.proto
message SignEIP712Message {
uint32 network = 1;
Bip32Path path = 2;
string msg = 3;
}
  • network: Network identifier, see NETWORKS
  • path: BIP32 path of the key for signing the message
  • msg: Message to be signed, JSON string.

Response

ethereum.proto
message ECDSASignResult {
uint32 v = 1;
bytes r = 2;
bytes s = 3;
}

SIGN_EIP712_HASHED_MESSAGE

Request

ethereum.proto
message SignEIP712HashedMessage {
uint32 network = 1;
Bip32Path path = 2;
bytes domainHash = 3;
bytes messageHash = 4;
}
  • network: Network identifier, see NETWORKS
  • path: BIP32 path of the key for signing the message
  • domainHash: EIP712 Domain Hash
  • messageHash: EIP712 Message Hash

Response

ethereum.proto
message ECDSASignResult {
uint32 v = 1;
bytes r = 2;
bytes s = 3;
}

SIGN_TRANSACTION

The function signs an Ethereum transaction by employing the Recursive Length Prefix (RLP) encoding scheme. RLP is used to serialize and structure the various components of the transaction, such as the nonce, gas price, gas limit, recipient address, value, data, and signature components.

Request

ethereum.proto
message SignTransaction {
uint32 network = 1;
Bip32Path path = 2;
bytes rawTx = 3;
repeated TokenMetadata tokens = 4;
}
  • network: Network identifier, see NETWORKS
  • path: BIP32 path of the key for signing the message
  • rawTx: RLP-encoded Ethereum transaction
  • tokens: list of TokenMetadata

Response

ethereum.proto
message ECDSASignResult {
uint32 v = 1;
bytes r = 2;
bytes s = 3;
}