Blockchain storage

You can store data records on the blockchain. A record is stored permanently: it cannot be changed, deleted, or modified by anyone and will be stored on the blockchain forever.

Store a log record

2 credits per API call + additional credits based on the size of the stored data and the type of the blockchain

Store data on the blockchain.

The total cost of a transaction on Ethereum (in credits) depends on the size of the data. The data is stored as a string in the hexadecimal format, and the maximum size of the data is approximately 130 kB on the mainnet and 30 kB on testnet. Every 5 characters cost 1 credit.
Therefore, one API call with 1 kB of data (1024 characters) would cost 205 credits.

This API is supported for the following blockchains:

  • BNB Smart Chain
  • Celo
  • Elrond
  • Ethereum (only the mainnet or the Sepolia testnet)
  • Harmony
  • Klaytn
  • Polygon
  • XDC
SecurityX-API-Key
Request
Request Body schema: application/json
required
One of:
data
required
string [ 1 .. 130000 ] characters

The data to be stored on the blockchain

chain
required
string

The blockchain to store the data on

Enum: "BSC" "EGLD" "ETH" "KLAY" "MATIC" "ONE" "XDC"
fromPrivateKey
required
string = 66 characters

The private key of the blockchain address from which the transaction will be made and the transaction fee will be deducted

from
string [ 42 .. 62 ] characters

(Elrond only; required) The blockchain address from which the transaction will be made
This is a mandatory parameter for Elrond. Do not use it with any other blockchain.

to
string = 42 characters

The blockchain address to store the data on
If not provided, the data will be stored on the address from which the transaction is made.

nonce
number >= 0

The nonce to be set to the transaction; if not present, the last known nonce will be used

fromShardID
number [ 0 .. 4 ]

(Harmony only) The ID of the shard from which the data should be read

toShardID
number [ 0 .. 4 ]

(Harmony only) The ID of the shard to which the data should be recorded

object (CustomFee)

(Ethereum only) The custom defined fee; if not present, will be calculated automatically

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

The price for one gas unit (in Gwei)

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

The maximum number of gas units that you are willing to spend on processing the transaction at the provided gas price

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 perform the required operation due to a logical error or invalid permissions.

500

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

post/v3/record
Request samples
application/json
{
  • "data": "My example log data",
  • "chain": "ETH",
  • "fromPrivateKey": "0x05e150c73f1920ec14caa1e0b6aa09940899678051a78542840c2668ce5080c2"
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Get a log record

1 credit per API call

Get a log data record from the Ethereum blockchain (only the mainnet or the Sepolia testnet).

SecurityX-API-Key
Request
query Parameters
chain
required
string

The blockchain to get the log record from

Value: "ETH"
Example: chain=ETH
id
required
string [ 1 .. 100 ] characters

The ID of the log record or transaction to get from the blockchain

Example: id=0x94Ce79B9F001E25BBEbE7C01998A78F7B27D1326
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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/record
Request samples
Response samples
application/json
{
  • "data": "My example log data"
}