Ethereum API
A set of methods for obtaining public keys, signing messages, and transactions specific to the Ethereum network and protocols based.
Networks
Network | Symbol | ID | Chain | Description |
---|---|---|---|---|
Ethereum | ETH | 1 | 1 | The Ethereum mainnet is the primary blockchain network for executing smart contracts and decentralized applications (DApps) on the Ethereum platform. |
Goerli | tETH | 2 | 5 | Goerli is an Ethereum testnet that utilizes the proof-of-authority consensus, designed for testing and ensuring compatibility across various Ethereum clients. |
Polygon | MATIC | 3 | 137 | Polygon 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. |
Optimism | ETH | 4 | 10 | Optimism 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. |
Arbitrum | ETH | 5 | 42161 | Arbitrum 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 Chain | BNB | 6 | 56 | Binance 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) | AVAX | 7 | 43114 | Avalanche 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 Network | WBT | 8 | 1875 | WB Network operates on a Proof-of-Authority (PoA) consensus mechanism, leveraging trusted validators to secure the blockchain and ensure efficient and reliable transaction processing. |
Base | ETH | 9 | 8453 | Base 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. |
Sepolia | tETH | 10 | 11155111 | Sepolia 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
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
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
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
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
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
message ECDSASignResult {
uint32 v = 1;
bytes r = 2;
bytes s = 3;
}
SIGN_EIP712_HASHED_MESSAGE
Request
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
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
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
message ECDSASignResult {
uint32 v = 1;
bytes r = 2;
bytes s = 3;
}