Ethereum

Ethereum is a decentralized, open-source blockchain. With Tatum, you can access the most commonly used Ethereum methods. These methods bring a certain level of abstraction and are used for applications that communicate with the blockchain directly. Some of the methods are used alongside virtual accounts to connect the blockchain and a virtual account, like generating a wallet or getting information about transactions.

Tatum supports the following Ethereum networks:

  • Mainnet, the primary public production blockchain
  • Sepolia, a proof-of-work testnet and the default testnet for Ethereum. The testnet cryptocurrency has no value, and you can obtain it from a faucet (for example, FaucETH).

Generate Ethereum wallet

1 credit per API call.


Tatum supports BIP44 HD wallets. Because they can generate 2^31 addresses from 1 mnemonic phrase, they are very convenient and secure. A mnemonic phrase consists of 24 special words in a defined order and can restore access to all generated addresses and private keys.
Each address is identified by 3 main values:

  • Private Key - your secret value which should never be revealed
  • Public Key - a public address to be published
  • Derivation index - an index of generated address

Tatum follows the BIP44 specification and generates for Ethereum wallets with the derivation path m/44'/60'/0'/0. More about BIP44 HD wallets can be found here - https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki. Generates a BIP44 compatible Ethereum wallet.

SecurityX-API-Key
Request
query Parameters
mnemonic
string <= 500 characters

Mnemonic to use for generating extended public and private keys.

header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/wallet
Request samples
Response samples
application/json
{
  • "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  • "xpub": "xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid"
}

Generate Ethereum account address from Extended public key

1 credit per API call.


Generates an Ethereum account deposit address from an Extended public key. The deposit address is generated for the specific index - each extended public key can generate up to 2^31 addresses starting from index 0 until 2^31 - 1.

SecurityX-API-Key
Request
path Parameters
xpub
required
string

Extended public key of wallet.

Example: xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid
index
required
number

Derivation index of the address to be generated.

Example: 0
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/address/{xpub}/{index}
Request samples
Response samples
application/json
{
  • "address": "0xa7673161CbfE0116A4De9E341f8465940c2211d4"
}

Generate Ethereum private key

1 credit per API call.


Generates the private key of an address from a mnemonic for a given derivation path index. The private key is generated for the specific index - each mnemonic can generate up to 2^32 private keys starting from index 0 until 2^31 - 1.

SecurityX-API-Key
Request
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Request Body schema: application/json
index
required
integer <= 2147483647

Derivation index of private key to generate.

mnemonic
required
string [ 1 .. 500 ] characters

Mnemonic to generate private key from.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

post/v3/ethereum/wallet/priv
Request samples
application/json
{
  • "index": 0,
  • "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse"
}
Response samples
application/json
{
  • "key": "cTmS2jBWXgFaXZ2xG9jhn67TiyTshnMp3UedamzEhGm6BZV1vLgQ"
}

Web3 HTTP driverDeprecated

2 credits per API call

This endpoint is deprecated. Use the HTTP-based JSON RPC driver instead.


Use this endpoint URL as an http-based web3 driver to connect directly to the Ethereum node provided by Tatum. To learn more about Ethereum Web3, visit the Ethereum developers' guide.

SecurityX-API-Key
Request
path Parameters
xApiKey
required
string

Tatum X-API-Key used for authorization.

Example: asdlkfjnqunalkwjfnq2oi303294857k
query Parameters
testnetType
string
Default: "ethereum-sepolia"

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Request Body schema: application/json
object

Any valid Web3 method content body.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

post/v3/ethereum/web3/{xApiKey}
Request samples
application/json
{
  • "jsonrpc": "2.0",
  • "method": "web3_clientVersion",
  • "params": [ ],
  • "id": 2
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 2,
  • "result": "Geth/v1.9.9-omnibus-e320ae4c-20191206/linux-amd64/go1.13.4"
}

Get current block number

1 credit per API call.


Gets the current Ethereum block number. This is the number of the latest block in the blockchain.

SecurityX-API-Key
Request
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/block/current
Request samples
Response samples
application/json
6491272

Get Ethereum block by hash

1 credit per API call.


Gets an Ethereum block-by-block hash or block number.

SecurityX-API-Key
Request
path Parameters
hash
required
string

Block hash or block number

Example: 6470657
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/block/{hash}
Request samples
Response samples
application/json
{
  • "difficulty": "3296820833",
  • "extraData": "0x",
  • "gasLimit": 8000000,
  • "gasUsed": 7985124,
  • "hash": "0x5d40698ee1b1ec589035f2a39c6162287e9056868cc79d66cfb248ba9f66c3fc",
  • "logsBloom": "0x042080004210492080800001610060ad9600005bc81502020800000043e302020381a404000100409102040240300641108004000400007000008000c049558055a800000a0001800748900806502004200400108205005418c0218802281a0408060000533210462021050470810a010140102809011814018281115020090201068401847000a04010000c00084062000485640d00020220181150020008589105a41c0880001112034100010882545410240011402a3480050104004c310204000002009490d0012022a040c20c20011020401020140250805100410060008280200008181a220114102800001648640828200c00a94c1003a2060e001000",
  • "miner": "0xD8869d9E3d497323561Fbca2319a9FC3F6f10c4B",
  • "mixHash": "0x7a44a1f56f12ae825fdc04550d7c3af2344daab987691771c06235f25fafcaa6",
  • "nonce": "0xfa1692f52a7ac672",
  • "number": 6470657,
  • "parentHash": "0xd34aab8a455027086ac54034e68608c84d984401a883b7b5d91f9ae0bbefda15",
  • "receiptsRoot": "0x4a496b6b7f2a1c5850bf9eebbea7193807be0067b1c06f17b9dde4eef7b2f960",
  • "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  • "size": 15296,
  • "stateRoot": "0x32757c92f10c6c5a106c6fb4b9ca3ff301e413a59ca3d0513b4bf98c72efddba",
  • "timestamp": 1569600592,
  • "totalDifficulty": "23329673338013873",
  • "transactions": [
    ],
  • "transactionsRoot": "0x5990081ef8515d561b50255af03c5d505f7725ddef27405dc67d23bfd0f47704"
}

Get Ethereum account balance

1 credit per API call.


Gets an Ethereum account balance in ETH. This method does not display the balance of ERC20 or ERC721 tokens in the account.

SecurityX-API-Key
Request
path Parameters
address
required
string

Account address you want to get balance of

Example: 0x3223AEB8404C7525FcAA6C512f91e287AE9FfE7B
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/account/balance/{address}
Request samples
Response samples
application/json
{
  • "balance": "10.52"
}

Get Ethereum Transaction

1 credit per API call.


Get Ethereum transaction by transaction hash.

SecurityX-API-Key
Request
path Parameters
hash
required
string

Transaction hash

Example: 0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

404

Transaction not found.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/transaction/{hash}
Request samples
Response samples
application/json
{
  • "blockHash": "0xcf2c40f475e78c7c19778e1ae999a0e371c9319b38182ea15dc94536f13f9137",
  • "status": true,
  • "blockNumber": 6470854,
  • "from": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
  • "gas": 21000,
  • "gasPrice": "1000000000",
  • "transactionHash": "0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7",
  • "input": "0x",
  • "nonce": 26836405,
  • "to": "0xbC546fa1716Ed886967cf73f40e8F2F5e623a92d",
  • "transactionIndex": 3,
  • "value": "1000000000000000000",
  • "gasUsed": 21000,
  • "cumulativeGasUsed": 314159,
  • "contractAddress": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
  • "logs": [
    ]
}

Get count of outgoing Ethereum transactions

1 credit per API call.


Get a number of outgoing Ethereum transactions for the address. When a transaction is sent, there can be multiple outgoing transactions, which are not yet processed by the blockchain. To distinguish between them, there is a counter called a nonce, which represents the order of the transaction in the list of outgoing transactions.

SecurityX-API-Key
Request
path Parameters
address
required
string = 42 characters

address

Example: 0xdac17f958d2ee523a2206206994597c13d831ec7
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/transaction/count/{address}
Request samples
Response samples
application/json
5

Get Ethereum transactions by address

1 credit per API call.


Get Ethereum transactions by address. This includes incoming and outgoing transactions for the address.

SecurityX-API-Key
Request
path Parameters
address
required
string

Account address you want to get balance of

Example: 0x8ce4e40889a13971681391aad29e88efaf91f784
query Parameters
pageSize
required
number [ 1 .. 50 ]

Max number of items per page is 50.

Example: pageSize=10
offset
number

Offset to obtain next page of the data.

Example: offset=0
from
number >= 1

Transactions from this block onwards will be included.

Example: from=1087623
to
number >= 1

Transactions up to this block will be included.

Example: to=1087823
sort
string
Default: "DESC"

Sorting of the data. ASC - oldest first, DESC - newest first.

Enum: "ASC" "DESC"
Example: sort=ASC
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/account/transaction/{address}
Request samples
Response samples
application/json
[
  • {
    }
]

Send Ethereum / ERC20 from account to account

2 credits per API call

Send Ethereum or Tatum supported ERC20 token from account to account.

Signing a transaction

When sending ETH, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.

Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.

For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.

SecurityX-API-Key
Request
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Request Body schema: application/json
One of:
data
string <= 50000 characters

Additinal data, that can be passed to blockchain transaction as data property. Only for ETH transactions.

nonce
number >= 0

Nonce to be set to Ethereum transaction. If not present, last known nonce will be used.

to
required
string = 42 characters

Blockchain address to send assets

currency
required
string

Currency to transfer from Ethereum Blockchain Account.

Enum: "USDT" "LEO" "LINK" "UNI" "FREE" "GMC" "GMC_BSC" "RMD" "MKR" "USDC" "BAT" "TUSD" "BUSD" "PAX" "PAXG" "MMY" "WBTC" "XCON" "ETH"
object

Custom defined fee. If not present, it will be calculated automatically.

gasLimit
required
string^[+]?\d+$

Gas limit for transaction in gas price.

gasPrice
required
string^[+]?\d+$

Gas price in Gwei.

amount
required
string^[+]?((\d+(\.\d*)?)|(\.\d+))$

Amount to be sent in Ether.

fromPrivateKey
required
string = 66 characters

Private key of sender address. Private key, or signature Id must be present.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

post/v3/ethereum/transaction
Request samples
application/json
{
  • "to": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  • "currency": "ETH",
  • "amount": "100000",
  • "fromPrivateKey": "0x05e150c73f1920ec14caa1e0b6aa09940899678051a78542840c2668ce5080c2"
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Invoke a method in a smart contract on Ethereum

2 credits per API call

Invoke a method in an existing smart contract on Ethereum.

You can call a read-only or write method.

  • For read-only methods, the output of the invoked method is returned.
  • For write methods, the ID of the associated transaction is returned.

Signing a transaction

When invoking a method in a smart contract, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.

Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.

For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.

SecurityX-API-Key
Request
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Request Body schema: application/json
One of:
contractAddress
required
string = 42 characters

The address of the smart contract

methodName
required
string [ 1 .. 500 ] characters

Name of the method to invoke on smart contract.

methodABI
required
object

ABI of the method to invoke.

params
required
Array of objects

Parameters of the method to be invoked.

amount
string^[+]?((\d+(\.\d*)?)|(\.\d+))$

Amount of the assets to be sent.

fromPrivateKey
required
string = 66 characters

Private key of sender address. Private key, or signature Id must be present.

nonce
number >= 0

Nonce to be set to Ethereum transaction. If not present, last known nonce will be used.

object

Custom defined fee. If not present, it will be calculated automatically.

gasLimit
required
string^[+]?\d+$

Gas limit for transaction in gas price.

gasPrice
required
string^[+]?\d+$

Gas price in Gwei.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

post/v3/ethereum/smartcontract
Request samples
application/json
{
  • "contractAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  • "methodName": "transfer",
  • "methodABI": {
    },
  • "params": [
    ],
  • "fromPrivateKey": "0x05e150c73f1920ec14caa1e0b6aa09940899678051a78542840c2668ce5080c2"
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Get Ethereum internal transactions by address

1 credit per API call.


Get Ethereum internal transactions by address.

SecurityX-API-Key
Request
path Parameters
address
required
string

Account address you want to get balance of

Example: 0x8ce4e40889a13971681391aad29e88efaf91f784
query Parameters
pageSize
required
number [ 1 .. 50 ]

Max number of items per page is 50.

Example: pageSize=10
offset
number

Offset to obtain next page of the data.

Example: offset=0
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/ethereum/account/transaction/erc20/internal/{address}
Request samples
Response samples
application/json
[
  • {
    }
]

Broadcast signed Ethereum transaction

2 credits per API call

Broadcast signed transaction to Ethereum blockchain. This method is used internally from Tatum KMS, Tatum Middleware or Tatum client libraries. It is possible to create custom signing mechanism and use this method only for broadcasting data to the blockchain.

SecurityX-API-Key
Request
header Parameters
x-testnet-type
string
Default: ethereum-sepolia

Type of Ethereum testnet. Defaults to ethereum-sepolia.

Value: "ethereum-sepolia"
Request Body schema: application/json
txData
required
string [ 1 .. 500000 ] characters

Raw signed transaction to be published to network.

signatureId
string <uuid>

ID of prepared payment template to sign. Required only, when broadcasting transaction signed by Tatum KMS.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

post/v3/ethereum/broadcast
Request samples
application/json
{
  • "txData": "62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}