NAV Navbar

Introduction

QuarkChain is an innovative permissionless blockchain architecture that aims to provide a secure, decentralized, and scalable blockchain solution to deliver 100,000+ on-chain TPS.

QuarkChain fully supports Ethereum smart contract enabling developers to write and debug smart contract quickly using popular tools like remix and build scalable DApps that will be free from network congestion. As you may know, CryptoKitties, one of the most popular blockchain games, severely slowed down the transactions on Ethereum in Dec 2017 and resulted in network congestion for weeks. It shows the importance of scalability issues.

QuarkChain has recently launched a public testnet with 6450 nodes and 256 shards and presented a live demo of 10K+ TPS which is about 500X Ethereum’s throughput.

The main features of QuarkChain include:

Basic Concepts

Address

A QuarkChain address is 24 bytes instead of 20 bytes as specified in Ethereum. The first 20 bytes which is called Recipient are generated the same way as an Ethereum address. The next 4 bytes encode a FULL_SHARD_ID which is randomly generated when a new address is created. For example, the following is a QuarkChain address.

QuarkChain network consists of a certain number of shards (SHARD_SIZE) which is always a power of 2. To find the shard an address belongs to, we use the following function

With the same function you can build addresses of the same recipient for different shards. This will allow a single recipient to receive QKC in any shard.

Another common value returned in JSON RPC is called branch, which is defined as

where the most significant bit indicates the number of shards in the network. By supplying a branch value, we can identify a unique shard regardless of sharding state (pre/post reshard).

Note that addresses used in an EVM smart contract are still 20 bytes (the recipient in QuarkChain) as the execution scope of a smart contract cannot go beyond the shard it belongs to.

Transaction

These are the fields for a transaction:

fields = [
    ('nonce', big_endian_int),
    ('gasprice', big_endian_int),
    ('startgas', big_endian_int),
    ('to', utils.address),
    ('value', big_endian_int),
    ('data', binary),
    ('fromFullShardId', BigEndianInt(4)),
    ('toFullShardId', BigEndianInt(4)),
    ('networkId', big_endian_int),
    ('version', big_endian_int),
    ('v', big_endian_int),
    ('r', big_endian_int),
    ('s', big_endian_int),
]

To the right is the Python definition of a transaction in Quarkchain.

Three fields are added onto the existing Ethereum transaction data structure.

Field Type Description
fromFullShardId 4 bytes fixed int Identifies the source shard of the transaction
toFullShardId 4 bytes fixed int Identifies the destination shard of the transaction
networkId int identifies the network e.g. testnet, mainnet (similar to ethereum's chain id which is hacked into the 'v' field)
version int identifies the signature style; 0: eth-style signature; 1: typed signature (EIP-712) as implemented by MetaMask before #4803

Note that when constructing a transaction, fromFullShardId should be the last 4 bytes of the sender's address, to should be the recipient of the receiver’s address, i.e., first 20 bytes from receiver's address, and toFullShardId should be the full shard id, i.e., last 4 bytes of the receiver's address. networkId should be 3 for current beta version of testnet.

Transaction Id and Block Id

In QuarkChain we use transaction id and block id to identify transaction and block rather than the transaction hash and block hash used in Ethereum. The id is simply the hash with a full shard id appended so that the object can be looked up directly from the shard.

Root block id is equal to its hash as it does not belong to any shard.

Minor block refers to the block on each shard.

Smart Contracts

QuarkChain runs EVM on each shard and thus supports all Ethereum smart contract bytecode compiled from Solidity.

Deployment

A smart contract is always deployed to a specific shard decided by toFullShardId in the transaction. Similar to Ethereum, leave the to field empty and put the byte code in the data field.

fromFullShardId and toFullShardId must map to the same shard in order to succeed, i.e., the same shard id according to Eq. (1). The fullShardId of the contract address created will be the same as toFullShardId. Normally you should just set toFullShardId the same as fromFullShardId.

A couple of comments on smart contract deployment:

Calling a Smart Contract

Calling a smart contract is simliar to Ethereum -- you can either use the UI on the blockchain explorer and load the ABI, or you can use a library like web3 that handles the interfacing for you. As a note, fromFullShardId and toFullShardId must map to the same shard in order for the call to succeed. Otherwise gas will be consumed but the contract will not be called.

Tutorial

Support for DApp development is still at early stage though we aim at providing the same level of development experience as Ethereum eventually. This tutorial assumes readers have basic knowledge of Ethereum smart contract development and thus it focuses on the contract deployment and invocation on QuarkChain network. Also please read the Basic Concepts before proceeding with the tutorial.

Quarkchain + Web3.js

QuarkChain’s client library quarkchain-web3.js is built around web3.js which is the Javascript-based client library for Ethereum. Please visit the quarkchain-web3.js github repo for the API and examples. MetaMask is required to manage accounts and sign transactions if you are using quarkchain-web3.js. Follow the steps below to try it out, or you can navigate to the API Access section for more direct usage.

The below Javascript will retrieve your QKC balance:

QuarkChain.injectWeb3(web3, "http://jrpc.testnet.quarkchain.io:38391");
var ethAddr = web3.eth.accounts[0];  // current ETH account in MetaMask
var qkcAddr = QuarkChain.getQkcAddressFromEthAddress(ethAddr);
web3.qkc.getBalance(qkcAddr).toString(10);  // balance in wei

 1. Install MetaMask and create an account.

 2. Visit http://testnet.quarkchain.io/wallet and verify your MetaMask account is shown on the page

 3. Open the browser console where web3 is automatically injected by MetaMask

 4. Run the Javascript command to verify everything has been set up correctly (ping us on Telegram if you need testnet tokens)

Create wallet

Disable MetaMask and navigate to https://testnet.quarkchain.io/wallet to get a new address. Copy-paste the private key somewhere for signing transactions and recover the address later.

Send Transaction

Below you will find the Javascript code change to ethereumjs-tx that we use in our testnet frontend.

var fields = [
    { name: 'nonce', ... },
    { name: 'gasPrice', ... },
    { name: 'gasLimit', ... },
    { name: 'to', ... },
    { name: 'value', ... },
    { name: 'data', ... },
    // BEGIN QUARKCHAIN FIELDS
    {
        name: 'fromFullShardId',
        length: 4,
    }, {
        name: 'toFullShardId',
        length: 4,
    }, {
        name: 'networkId',
        length: 32,
        allowLess: true,
        default: new Buffer([])
    },
    // END QUARKCHAIN FIELDS
    { name: 'v', ... },
    { name: 'r', ... },
    { name: 's', ... }
];

Both contract deployment and invocation are performed through sending specially crafted transactions to the QuarkChain network through JSON RPC sendRawTransaction which accepts a serialized transaction object in RLP. Existing Ethereum libraries (e.g., ethereumjs-tx) can be used to create, sign, and serialize transaction objects. However, small changes are required to accommodate the 3 fields added specifically for QuarkChain.

With the above changes we can use the following Javascript code to build a transaction, sign the transaction, and send it to the QuarkChain testnet API.

const txParams = {
    nonce: '0x00',
    gasPrice: '0x09184e72a000',
    gasLimit: '0x2710',
    to: '0x1234567890123456789012345678901234567890',  // recipient of to address
    value: '0x12',
    data: '0x7f746573743',
    fromFullShardId: '0x12345678',  // full shard id of from address
    toFullShardId: '0x12345678',  // full shard id of to address
    networkId: '0x3',
}

const tx = new ethereumjs.Tx(txParams)
const key = '0x...'
tx.sign(ethereumjs.Util.toBuffer(key))
const rawTx = "0x" + tx.serialize().toString("hex")

// Send raw transaction through the testnet web server
try {
    var txResp = await axios.post("https://testnet.quarkchain.io/sendRawTx", {
        rawTx: rawTx,
    });
    // To check transaction status use this id to call getTransactionReceipt
    const txId = txResp.data.txId;
} catch (error) {
    console.log("Sending transaction failed");
}

Contract Deployment

First get the bytecode of the contract you want to deploy, using a tool like Remix. Then you have two options to deploy the contract.

  1. (EASY) Simply go to https://testnet.quarkchain.io/contract and deploy the contract through the UI. On the transaction status page you may find the contract address once the transaction is confirmed.

  2. (HARD) Send a transaction with 'to' left empty, toFullShardId set to the same value as fromFullShardId, data filled with the bytecode in hex. Once the transaction is confirmed call getTransactionReceipt with the transaction id to retrieve the contract address.

Contract Invocation

Calling via the testnet API endpoint

try {
    var txResp = await axios.post("https://testnet.quarkchain.io/call", {
        rawTx: rawTx,
    });
    console.log(txResp);
} catch (error) {
    console.log("Call failed");
}

Read

To read data from the contract without modifying the state on the blockchain, create a transaction with the contract function or variable encoded into the data field and use the JSON RPC call interface to retrieve the results. Ethereumjs-abi or other similar libraries can be used to handle encoding.

Write

Similar to read but use sendRawTransaction instead of call to submit the transaction. Like previous example check transaction status through getTransactionReceipt.

JSON RPC

QuarkChain JSON RPC shares the similar interfaces with Ethereum and follows the same HEX value encoding. The most notable difference is the shard id in certain APIs.

The RPCs run on HTTP. All the operations are performed on the lastest blocks.

networkInfo

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "networkInfo",
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": {
      "networkId": "0x3",
      "shardSize": "0x80",
      "syncing": false},
    "id": 1
}
Param Name Type Description
None
Return Value Type Description
networkId QUANTITY integer of the network id
shardSize QUANTITY integer of the current number of shards in the network
syncing BOOL whether the cluster is sync'ing (depends on which cluster the API connects to)

getTransactionCount

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "getTransactionCount",
    "params": ["0x68fB978BF0e4c69bA338D4Fa5A4e5EAA88438AA819e189EC"],
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": "0x1",
    "id": 1
}

Returns the number of transactions sent from an address. Similar to Ethereum, the transaction count is guaranteed to be non-decreasing.

Param Name Type Description
-- DATA, 24 bytes address you want balance of
Return Value Type Description
-- QUANTITY number of transactions sent from the address

getBalance

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "getBalance",
    "params": ["0x68fB978BF0e4c69bA338D4Fa5A4e5EAA88438AA819e189EC"],
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": {
        "branch": "0xc",
        "shard": "0x4",
        "balance": "0xd3c20ded573b8a34e000"
    },
    "id": 1
}

Returns the balance of the account of given address.

Param Name Type Description
-- DATA, 24 bytes address you want information about
Return Value Type Description
-- QUANTITY integer of the current balance in wei

getAccountData

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "getAccountData",
    "params": ["0x68fB978BF0e4c69bA338D4Fa5A4e5EAA88438AA819e189EC", true],
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": {
        "primary": {
            "branch": "0xc",
            "shard": "0x4",
            "balance": "0xd3c20ded573b8a34e000",
            "transactionCount": "0x1"
        },
        "shards": [
            {
            "branch": "0x8",
            "shard": "0x0",
            "balance": "0x0",
            "transactionCount": "0x0"
            },
            ...
        ]
    },
    "id": 1
}

Aggregated account data including both primary and secondary addresses (i.e. addresses in other shards).

Param Name Type Description
-- DATA, 24 bytes
-- BOOL true to include data from other shards, otherwise false
Return Value Type Description
primary JSON object account data from primary shard
shards JSON array list of account datas from secondary (other) shards
branch QUANTITY integer of the branch; see Address section for more details
shard QUANTITY integer of the shard
balance QUANTITY integer of the token balance
transactionCount QUANTITY number of transactions sent from address

sendTransaction

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "sendTransaction",
    "params": {
        "nonce": "0x4",
        "gasPrice": "0x2540be400",  // 10 Gwei
        "gas": "0x7530",  // 30000
        "value": "0xde0b6b3a7640000",  // 1 QKC
        "data": "0x",
        "fromFullShardId": "0x19e189ec",
        "toFullShardId": "0x18f9ba2c",
        "networkId": "0x3",
        "to": "0x283B50c1326F5C09BA792cc0Ad6C08b5035a36711",
        "v": "0x1a",
        "r": "0x293d59ef8705e34585d646f5899530d52a2d39b312fd061607036152e5fcf589",
        "s": "0x98d2e479720cee2be165703dd97085765adc65b18ed8d9dfbf3d6d7e7fe5a6e"
    },
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": "0xa786dc17bf8b302d8678666e5f97290c6467c4302a0a1402cb7693267152402519e189ec",
    "id": 1
}

Create a new message call transaction or a contract creation, if the data field contains code. Note the transaction needs to be signed by the client (for example, ethereumjs-tx).

Param Name Type Description
nonce QUANTITY (optional) integer of a nonce, for overriding your pending transactions that use the same nonce
gasPrice QUANTITY integer of the gas price used for each paid gas
gas QUANTITY integer of the gas provided for the transaction execution
value QUANTITY (optional) integer of the value sent with this transaction
data DATA compiled code of a contract, OR, the hash of the invoked method signature with encoded parameters
fromFullShardId QUANTITY, 4 bytes integer of the full shard id for sending address, see Address for more info
toFullShardId QUANTITY, 4 bytes integer of the full shard id for receiving address
networkId QUANTITY integer of the id of the network (e.g. testnet, mainnet)
to DATA, 20 bytes recipient's address, that does NOT include the toFullShardId
v QUANTITY ECDSA recovery id
r DATA, 32 bytes ECDSA signature r
s DATA, 32 bytes ECDSA signature s

Notes:

Return Value Type Description
-- DATA, 36 bytes the transaction id or null on failure

sendRawTransaction

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "sendRawTransaction",
    "params": ["0xf877048502540be40082753094283b50c1326f5c09ba792cc0ad6c08b5035a3671880de0b6b3a7640000808419e189ec8418f9ba2c031ba0293d59ef8705e34585d646f5899530d54a2d39b312fd061607036152e5fcf580a0098d2e479720cee2be565703dd97085765adc65b18ed8d9dfbf3d6d7e7fe556e"],
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": "0xa786dc17bf8b302d8678666e5f97290c6467c4302a0a1402cb7693267152402519e189ec",
    "id": 1
}

Creates new message call transaction or a contract creation for signed transactions.

Param Name Type Description
-- DATA signed transaction data
Return Value Type Description
-- DATA, 36 bytes the transaction id or null on failure

getTransactionById

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "getTransactionById",
    "params": ["0x444c7a867fcf2621ab258560fa03fd9ba072fc3c5ec585049675d2dd920217f419e189ec"],
    "id": 1
}'

// Result
{
    'id': 1,
    'jsonrpc': '2.0',
    'result': {
        'blockHeight': '0x23fe',
        'blockId': '0x4d2cb8f556805a1c26b97e92bfdd7aadb746c42c9ba0891237ad40d7bb78c9a40000006c',
        'data': '0x',
        'from': '0x68fb978bf0e4c69ba338d4fa5a4e5eaa88438aa8',
        'fromFullShardId': '0x19e189ec',
        'toFullShardId': '0x19e189e6',
        'fromShardId': '0x6c',
        'toShardId': '0x66',
        'gas': '0x7530',
        'gasPrice': '0x2540be400',
        'hash': '0x444c7a867fcf2621ab258560fa03fd9ba072fc3c5ec585049675d2dd920217f4',
        'id': '0x444c7a867fcf2621ab258560fa03fd9ba072fc3c5ec585049675d2dd920217f419e189ec',
        'networkId': '0x3',
        'nonce': '0x3',
        'timestamp': '0x5b2a7da6',
        'to': '0x68fb978bf0e4c69ba338d4fa5a4e5eaa88438aa8',
        'transactionIndex': '0x0',
        'v': '0x1c',
        'r': '0xdceb1caf9e8e01be65f3732bb7ee4ba7914d567a65e832a681e215d6f06a069a',
        's': '0x414fc2a700954c58150fa86f5145e32c177a1aa2c8e2a0587571c5d01c7f868f',
        'value': '0x241a9b4f617a280000'
    }
}

Get transaction details with the transaction id returned from sendTransaction or sendRawTransaction.

Param Name Type Description
-- DATA, 36 bytes transaction id
Return Value Type Description
blockHeight QUANTITY integer of the block number this transaction was in
blockId DATA, 36 bytes hash of the block this transaction was in + full shard id
data DATA data sent along with the transaction
from DATA, 20 bytes sender's address, NOT including fromFullShardId
fromFullShardId QUANTITY, 4 bytes sender's full shard id
toFullShardId QUANTITY, 4 bytes recipient's full shard id
fromShardId QUANTITY integer of sender's shard number
toShardId QUANTITY integer of recipient's shard number
gas QUANTITY gas provided by the sender
gasPrice QUANTITY gas provided by the sender in Wei
hash DATA, 32 bytes hash of the transaction
id DATA, 36 bytes the full transaction id with the fromFullShardId appended
networkId QUANTITY integer of the id of the network (e.g. testnet, mainnet)
nonce QUANTITY number of transactions made by the sender prior to this one
timestamp QUANTITY unix time of the block this transaction is in (bigint)
to DATA, 20 bytes recipient's address, NOT including toFullShardId
transactionIndex QUANTITY integer of this transaction's index position in the block
v QUANTITY ECDSA recovery id
r DATA, 32 bytes ECDSA signature r
s DATA, 32 bytes ECDSA signature s
value QUANTITY value transferred in Wei

getTransactionReceipt

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "getTransactionReceipt",
    "params": ["0xf6ad8a1096ec8e11a922149e456a28b66cdb2bc6f64198b76f17d526db4e476c18f9ba2c"],
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": {
        "transactionId": "0xf6ad8a1096ec8e11a922149e456a28b66cdb2bc6f64198b76f17d526db4e476c18f9ba2c",
        "transactionHash": "0xf6ad8a1096ec8e11a922149e456a28b66cdb2bc6f64198b76f17d526db4e476c",
        "transactionIndex": "0x0",
        "blockId": "0xa175995eb0ff22213b1cad350c76e951549e86feb623f40bbee77261a19e57a60000002c",
        "blockHash": "0xa175995eb0ff22213b1cad350c76e951549e86feb623f40bbee77261a19e57a6",
        "blockHeight": "0x27dd",
        "cumulativeGasUsed": "0x213eb",
        "gasUsed": "0x213eb",
        "status": "0x1",
        "contractAddress": "0x5756361f7216521e89f8b64d27c9fbac37565a9718f9ba2c"
    },
    "id": 1
}

Get the receipt of a transaction.

Param Name Type Description
-- DATA, 36 bytes transaction id
Return Value Type Description
transactionId DATA, 36 bytes transaction id, same as what you passed in the request
transactionHash DATA, 32 bytes transaction id minus the full shard id = the hash of the transaction
transactionIndex QUANTITY integer of this transaction's index position in the block
blockId DATA, 36 bytes hash of the block this transaction was in + full shard id
blockHash DATA, 32 bytes hash of the block
blockHeight QUANTITY integer of the block number this transaction was in
cumulativeGasUsed QUANTITY total amount of gas used when this transaction was executed in the block
gasUsed QUANTITY amount of gas used by this transaction alone
status QUANTITY either 1 (success) or 0 (failure)
contractAddress DATA, 24 bytes address of the contract created, if there was a contract created

call

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "call",
    "params": {
        "gasPrice": "0x2540be400",  // 10 Gwei
        "gas": "0x7530",  // 30000
        "value": "0x9184e72a",  // 1 QKC
        "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
        "fromFullShardId": "0x19e189ec",
        "toFullShardId": "0x18f9ba2c",
        "networkId": "0x3",
        "to": "0x283B50c1326F5C09BA792cc0Ad6C08b5035a36711",
        "v": "0x1a",
        "r": "0x293d59ef8705e34585d646f5899530d52a2d39b312fd061607036152e5fcf589",
        "s": "0x98d2e479720cee2be165703dd97085765adc65b18ed8d9dfbf3d6d7e7fe5a6e"
    },
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a68656c6c6f576f726c6400000000000000000000000000000000000000000000",
    "id": 1
}

Execute the byte code on the blockchain without creating a transaction.

Param Name Type Description
Same as sendTransaction
Return Value Type Description
-- DATA the return value of the executed contract

getRootBlockById

curl -X POST --data '{
    "jsonrpc": "2.0",
    "params": ["0x2a629116ab42c5856eaa73bc9a7ba4d81aeedf3810a64536f50b61d4276401e3"],
    "method": "getRootBlockById",
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": {
        "id": "0x2a629116ab42c5856eaa73bc9a7ba4d81aeedf3810a64536f50b61d4276401e3",
        "hash": "0x2a629116ab42c5856eaa73bc9a7ba4d81aeedf3810a64536f50b61d4276401e3",
        "height": "0x4b9",
        "idPrevBlock": "0x43e1f7803c27d4733a1f859b6322c0ec01b4456250e3673274aefe19ef053971",
        "hashPrevBlock": "0x43e1f7803c27d4733a1f859b6322c0ec01b4456250e3673274aefe19ef053971",
        "nonce": "0x0",
        "hashMerkleRoot": "0x9f8cffcea426dd7589dcc256e8f4d6916c18f29ca2f50498363fdac22495c845",
        "miner": "0x199bcc2ebf71a851e388bd926595376a49bdaa329c6485f3",
        "difficulty": "0x164ffb",
        "timestamp": "0x5b2a8d9e",
        "size": "0x1ddac",
        "minorBlockHeaders": [
            {
            "id": "0xedfbeeadfd6effee90435b4138968b2866da92eb6103f1f28956e1c8482b80c700000000",
            "height": "0x27ff",
            "hash": "0xedfbeeadfd6effee90435b4138968b2866da92eb6103f1f28956e1c8482b80c7",
            "branch": "0x80",
            "shard": "0x0",
            "idPrevMinorBlock": "0xa40fa9fa99f8a59697187862ae48a0e43d969c2ab65bcff661c91cd8e777906a00000000",
            "hashPrevRootBlock": "0x26eda441885162c5fe3941dea2858cbe5f8c9d1691731180ea2f62280be2db65",
            "nonce": "0x0",
            "difficulty": "0x516",
            "timestamp": "0x5b2a8d7c"
            },
            …
        ]
    }
}

Get root block details by root block id.

Param Name Type Description
-- DATA, 32 bytes root block id
Return Value Type Description
id DATA, 32 bytes root block id (also the hash); they are the same since we don't have shard ids at the root block level
hash DATA, 32 bytes hash of the root block (also the id)
height QUANTITY integer of the root block number
idPrevBlock DATA, 32 bytes id of the previous block (same as hash)
hashPrevBlock DATA, 32 bytes hash of the previous block (same as id)
nonce DATA, 8 bytes hash of the generated proof-of-work
hashMerkleRoot DATA hash of the merkle root for this root block
miner DATA, 20 bytes address of the beneficiary to whom the mining rewards were given
difficulty QUANTITY integer of the difficulty for this block
timestamp QUANTITY unix time of the root block
size QUANTITY integer of the size of this block in bytes

getRootBlockByHeight

Get root block details by height.

Param Name Type Description
-- QUANTITY integer of the root block number
Return Value Type Description
Same as in getRootBlockById

getMinorBlockById

curl -X POST --data '{
    "jsonrpc": "2.0",
    "params": ["0x1a4d27f3d62f9e98e4747ab10f036bbba61e86b92ca77d6154eaed0b410a8ab300000000", false],
    "method": "getMinorBlockById",
    "id": 1
}'

# Result
{
    "jsonrpc": "2.0",
    "result": {
        "id": "0x1a4d27f3d62f9e98e4747ab10f036bbba61e86b92ca77d6154eaed0b410a8ab300000000",
        "hash": "0x1a4d27f3d62f9e98e4747ab10f036bbba61e86b92ca77d6154eaed0b410a8ab3",
        "height": "0x2853",
        "branch": "0x80",
        "shard": "0x0",
        "hashPrevMinorBlock": "0x8b01edeca8a6d3a03eec817cba9f8d1d0e80fd370f724a16791643ae2f9e630f",
        "idPrevMinorBlock": "0x8b01edeca8a6d3a03eec817cba9f8d1d0e80fd370f724a16791643ae2f9e630f00000000",
        "hashPrevRootBlock": "0x38fd6898c81eed50affc3e5e094afcd1077d5b18e1dd5179c6c68f59a7748fef",
        "nonce": "0x0",
        "hashMerkleRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "hashEvmStateRoot": "0x561c89f7d4433a02f2d588722eb96bdc971c731c83624a7b790f557a93e030f5",
        "miner": "0x199bcc2ebf71a851e388bd926595376a49bdaa329c648580",
        "difficulty": "0x516",
        "extraData": "0x",
        "gasLimit": "0xb71b00",
        "gasUsed": "0x0",
        "timestamp": "0x5b2a8f04",
        "size": "0x186",
        "transactions": []
    },
    "id": 1
}

Get shard block details by block ID.

Param Name Type Description
-- DATA, 36 bytes minor block id
-- BOOL true to return transactions with the minor block
Return Value Type Description
id DATA, 36 bytes minor block id (includes full shard id as last 4 bytes)
hash DATA, 32 bytes hash of the minor block
height QUANTITY integer of the minor block number
branch QUANTITY integer of the branch; see Address section for more details
shard QUANTITY integer of the shard
idPrevMinorBlock DATA, 36 bytes id of the previous minor block (includes full shard id)
hashPrevMinorBlock DATA, 32 bytes hash of the previous minor block
hashPrevRootBlock DATA, 32 bytes id/hash of the root block it points to
nonce DATA, 8 bytes hash of the generated proof-of-work
hashMerkleRoot DATA, 32 bytes the merkle root for this minor block
hashEvmStateRoot DATA, 32 bytes the root of the evm state trie for this minor block
miner DATA, 20 bytes address of the beneficiary to whom the mining rewards were given
difficulty QUANTITY integer of the difficulty for this block
extraData DATA the "extra data" field of this block
gasLimit QUANTITY the maximum gas allowed in this block
gasUsed QUANTITY the total gas used by all transactions in this block
timestamp QUANTITY unix time of the root block
size QUANTITY integer of the size of this block in bytes
transactions JSON array list of the transactions in this block

getMinorBlockByHeight

curl -X POST --data '{"jsonrpc": "2.0", "params":["0x1", "0x27a5", false], "method": "getMinorBlockByHeight", "id": 1}'

Get minor (shard) block details by shard and height.

Param Name Type Description
-- QUANTITY integer of the shard number, ranges from 1 to SHARD_SIZE
-- QUANTITY integer of the minor block number
-- BOOL true to return transactions with minor block
Return Value Type Description
Same as getMinorBlockById