Validator API
Last updated
Last updated
Note: Thanks to your contributions, cycle I of our TestNet Phase 3 journey has officially wrapped up! Now we're one step closer to onboarding the world to Bitcoin. Stay tuned for the next steps!
OpenRPC
1.2.6
To learn how to run a Nubit validator, please refer to Run a Validator.
The Nubit Validator API provides a collection of RPC methods to interact with the services offered by the Nubit Validator. It adheres to the CometBFT RPC standard for these methods. For more details on the CometBFT RPC standard, please visit CometBFT RPC Documentation.
In addition to the CometBFT RPC standard methods, the Nubit Validator API also introduces additional methods, which are detailed below.
API version: v0.1.0-rc.1
Base URI path: /
Method: POST
Headers
Name | Value |
---|---|
Fetches the set of transactions at a specified height and all the relevant data to verify the transactions (i.e. using light client verification).
func SignedBlock(height int64) (*ctypes.ResultSignedBlock)
{
"jsonrpc": "2.0",
"method": "signed_block",
"params": ["10"],
"id": 0
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"header": {
"version": {
"block": "11",
"app": "1"
},
"chain_id": "nubit-alphatestnet-1",
"height": "10",
"time": "2024-05-25T03:14:41.904907227Z",
"last_block_id": {
"hash": "3ACF6A9F214E94EC5D95ED6CB734FD8B641B53710185FD80411CB9234A58AA02",
"parts": {
"total": 1,
"hash": "6DDF7E2ADF59D1828F19B1182256B2092E56DEB10C2AF42227F1F26A5CD27F56"
}
},
"last_commit_hash": "CD8B9A1E2268A14C6408040C29B3058832409B98A661CD9C773756FBA1212B23",
"data_hash": "CEF9F70E5C637DF775EE8163D5EBF627D75680B95EB103C2E93B12F3AA78AA1B",
"validators_hash": "D62F3F90C0150C49DB3B79054C7D0A9BBBAB0000B6CC05CBE631B6B8E99D42D4",
"next_validators_hash": "D62F3F90C0150C49DB3B79054C7D0A9BBBAB0000B6CC05CBE631B6B8E99D42D4",
"consensus_hash": "C0B6A634B72AE9687EA53B6D277A73ABA1386BA3CFC6D0F26963602F7F6FFCD6",
"app_hash": "D5732A3D7D21FD65652FDA9D38B2C4EB07EBB69E39D5B7D92A6F0991CBCFE9C7",
"last_results_hash": "4B94C111BD35AEC13F1BC10A4BD45D14D65042219725552FFE07A6DAB699E0DD",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "83592AD6A18494E38970AC673E150A986B717C35"
},
"commit": {
"height": "10",
"round": 0,
"block_id": {
"hash": "0BA5ED56EA415ECF272AB29348AC283448F4CFFA5589273272E86E9046339C80",
"parts": {
"total": 1,
"hash": "429FFAFC30C3B940ED667D2082A874CFFCC62D120962DD802161742C6A794E9A"
}
},
"signatures": [
{
"block_id_flag": 2,
"validator_address": "40F0D18D0454EF72DADBE564962E88EFEC3C148E",
"timestamp": "2024-05-25T03:14:53.547863335Z",
"signature": "EnQy5J/NWUaltzhmO57hHSNTeEzA1YoOUUC4mlBrdD6fL0uSg3gIF+0/4zepxZT/ywB2rHCWoP/ld5e58LgJCQ=="
},
{
"block_id_flag": 2,
"validator_address": "83592AD6A18494E38970AC673E150A986B717C35",
"timestamp": "2024-05-25T03:14:53.547489034Z",
"signature": "8LDxL8Lo+glm0lBN1edT4llxoeMzT/D/CwCDZzW5sUSF832BypjMVmIRFZ1R0p5OHAlXvqxLyI950vpDIo/IAw=="
},
{
"block_id_flag": 2,
"validator_address": "9D40034936981454FC48AA642304E6A7A69D0D20",
"timestamp": "2024-05-25T03:14:53.47284333Z",
"signature": "li9HqNYvR89+cxQjq400ZKq1FienKwZr+7DqXXeV8bP66N37FfDpV4a/6KxbOifAnC59m0GvG6je5a4VQtE+Ag=="
},
{
"block_id_flag": 2,
"validator_address": "E740D1B0211DBF2AA8D15061C1520B36C97EE9D8",
"timestamp": "2024-05-25T03:14:53.549386009Z",
"signature": "KKjekhn0077bbRyFSYjUQDVTS1LbeCqGR/g1+t971amtgH1jhFt7YeADBarc6KFP4UodCpEKfbGj5t0O9hrCDA=="
}
]
},
"data": {
"txs": ["CggSBjg0NTAxMRICEgA="],
"square_size": "1"
},
"validator_set": {
"validators": [
{
"address": "40F0D18D0454EF72DADBE564962E88EFEC3C148E",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "gyZY2TexgmhQqfOwF4fq4HekPq0y6vol6zseB3VNyW0="
},
"voting_power": "10000000",
"proposer_priority": "-20000000"
},
{
"address": "83592AD6A18494E38970AC673E150A986B717C35",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "pWdB06oa6r1Up9JzHHExMkh2mQvEl7JR4WtVRmxYWsw="
},
"voting_power": "10000000",
"proposer_priority": "-20000000"
},
{
"address": "9D40034936981454FC48AA642304E6A7A69D0D20",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "6dYjM53iZUfpEMCQa6V7b1bHMeHZg024u82z6vcmj/I="
},
"voting_power": "10000000",
"proposer_priority": "20000000"
},
{
"address": "E740D1B0211DBF2AA8D15061C1520B36C97EE9D8",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "VpD078m3gu5B/2vtf4RDEwXnL4XEXsuUGdYJqhRchuw="
},
"voting_power": "10000000",
"proposer_priority": "20000000"
}
],
"proposer": {
"address": "83592AD6A18494E38970AC673E150A986B717C35",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "pWdB06oa6r1Up9JzHHExMkh2mQvEl7JR4WtVRmxYWsw="
},
"voting_power": "100
Gets block header at a given height. If no height is provided, it will fetch the latest header.
func Header(height int64) *ctypes.ResultHeader
{
"jsonrpc": "2.0",
"method": "header",
"params": ["10"],
"id": 0
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"header": {
"version": {
"block": "11",
"app": "1"
},
"chain_id": "nubit-alphatestnet-1",
"height": "10",
"time": "2024-05-25T03:14:41.904907227Z",
"last_block_id": {
"hash": "3ACF6A9F214E94EC5D95ED6CB734FD8B641B53710185FD80411CB9234A58AA02",
"parts": {
"total": 1,
"hash": "6DDF7E2ADF59D1828F19B1182256B2092E56DEB10C2AF42227F1F26A5CD27F56"
}
},
"last_commit_hash": "CD8B9A1E2268A14C6408040C29B3058832409B98A661CD9C773756FBA1212B23",
"data_hash": "CEF9F70E5C637DF775EE8163D5EBF627D75680B95EB103C2E93B12F3AA78AA1B",
"validators_hash": "D62F3F90C0150C49DB3B79054C7D0A9BBBAB0000B6CC05CBE631B6B8E99D42D4",
"next_validators_hash": "D62F3F90C0150C49DB3B79054C7D0A9BBBAB0000B6CC05CBE631B6B8E99D42D4",
"consensus_hash": "C0B6A634B72AE9687EA53B6D277A73ABA1386BA3CFC6D0F26963602F7F6FFCD6",
"app_hash": "D5732A3D7D21FD65652FDA9D38B2C4EB07EBB69E39D5B7D92A6F0991CBCFE9C7",
"last_results_hash": "4B94C111BD35AEC13F1BC10A4BD45D14D65042219725552FFE07A6DAB699E0DD",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "83592AD6A18494E38970AC673E150A986B717C35"
}
}
}
Gets header by hash.
func HeaderByHash(hash bytes.HexBytes) *ctypes.ResultHeader
{
"jsonrpc": "2.0",
"method": "header_by_hash",
"params": [
"3ACF6A9F214E94EC5D95ED6CB734FD8B641B53710185FD80411CB9234A58AA02"
],
"id": 0
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"header": {
"version": {
"block": "11",
"app": "1"
},
"chain_id": "nubit-alphatestnet-1",
"height": "9",
"time": "2024-05-25T03:14:30.259255236Z",
"last_block_id": {
"hash": "F950A296962691C846690ADE41C8249B678B419C0F8AC4FDA815A02B3A8427EE",
"parts": {
"total": 1,
"hash": "6541C7DE859C752292FAA7519DE9DB8D04450EECC3A2F3FA3A4CF3DDDA7DE706"
}
},
"last_commit_hash": "BEC4561D4621E3F99522E58EE248B8D491F066461A76CBFFFA12C9E5BCF2033C",
"data_hash": "CEF9F70E5C637DF775EE8163D5EBF627D75680B95EB103C2E93B12F3AA78AA1B",
"validators_hash": "D62F3F90C0150C49DB3B79054C7D0A9BBBAB0000B6CC05CBE631B6B8E99D42D4",
"next_validators_hash": "D62F3F90C0150C49DB3B79054C7D0A9BBBAB0000B6CC05CBE631B6B8E99D42D4",
"consensus_hash": "C0B6A634B72AE9687EA53B6D277A73ABA1386BA3CFC6D0F26963602F7F6FFCD6",
"app_hash": "2EB4F49110D80D15C075BE69D15D66AA7148666EB4EB0D41A281655629F2A07B",
"last_results_hash": "21BF1411B88106050FB5AAE87A57B8A4F170500C80C28F827701636DDA0786FA",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "40F0D18D0454EF72DADBE564962E88EFEC3C148E"
}
}
}
Collects the data roots over a provided ordered range of blocks, and then creates a new Merkle root of those data roots. The range is end-exclusive.
func DataCommitment(
start uint64,
end uint64,
) *ctypes.ResultDataCommitment
{
"jsonrpc": "2.0",
"method": "data_commitment",
"params": ["3", "10"],
"id": 0
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"data_commitment": "25513398FBB47E0D958D18961F7C965166849BB898FB461B4DFFDE43FC701ECB"
}
}
Creates an NMT proof for a set of shares to a set of rows. It is end-exclusive.
func ProveShares(
height int64,
startShare uint64,
endShare uint64,
) types.ShareProof
{
"jsonrpc": "2.0",
"method": "prove_shares",
"params": [
"100", // Valid block height, ensure it's within the current blockchain height range
"0", // Start share
"1" // End share, ensure it's less than or equal to the number of shares in the block
],
"id": 0
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"data": [
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAACagAAACYOCggSBjg1MTUxNhICEgDZBAqqAwqLAQocL2Nvc21vcy5iYW5rLnYxYmV0YTEuTXNnU2VuZBJrCixudWJpdDE5ZzJjcjZlbTRuZjZucXlsajByNTUzazI2bGNjd2RkenZmbG56chIsbnViaXQxdHBlc3B1Z25hbTNlcnN3a2RtcGt6eG5yd3Y0dnNuNDN2bWV4N3QaDQoEdW51YhIFMTAwMDAKiwEKHC9jb3Ntb3MuYmFuay52MWJldGExLk1zZ1NlbmQSawosbnViaXQxOWcyY3I2ZW00bmY2bnF5bGowcjU1M2syNmxjY3dkZ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9eVmp0IWkQPISvw36hiaGUrARzcy6VV4BusIG/KINO6EvvDify1ERk7UmhIBAxoESU5EWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"proof": "lIwPNTPbFHgVDFkNL9TR/QtVE4Nl2mcz3mrxscqt+pEJvpk5yLRVrlklfSkpYAju"
},
"inclusion_or_absence": true
}
],
"namespace_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ==",
"row_proof": {
"row_roots": [
"00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000006D616E7461B097EED25E3578B593A644C997B27036250D4EF0AD93C024C3B7F4811F7BF685AAC34E59FC9FB45C5D2AA80F3203DE11"
],
"proofs": [
{
"total": "16",
"index": "0",
"leaf_hash": "2/abTK8+rHvo5tgsOcW+IUlchFdehWybXDHrBr6lN+Q=",
"aunts": [
"fYVXPClZb3D/xJSAZatnPTVsfHJ+aW0Dzc6V/sFIDQ0=",
"CvSdLaLdCCTr6Kp41MlcBOM0wDvaKvJjY8N5X8mqErc=",
"4frL6AvgYMIbETNBxZ0GB27XWF653fcIOynN0b7E388=",
"2s/b732KResSYYf7s5Xo5zDlZdEQZBLszGfNGbvNh+M="
]
}
],
"start_row": 0,
"end_row": 0
},
"namespace_version": 0
}
}
Creates an inclusion proof for the data root of block height height
in the set of blocks defined by start
and end
. The range is end-exclusive.
func DataRootInclusionProof(
height int64,
start,
end uint64,
) *ctypes.ResultDataRootInclusionProof
{
"jsonrpc": "2.0",
"method": "data_root_inclusion_proof",
"params": [
"5", // The block height for which the data root inclusion proof is being requested
"2", // The start block height for the inclusion proof range
"10" // The end block height for the inclusion proof range (exclusive)
],
"id": 0
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"proof": {
"total": "8",
"index": "3",
"leaf_hash": "xYo4wPp20Li0VgIHIy7WkGNckxLVI9AkEUsMvHdNsfU=",
"aunts": [
"fHGeOi40Y7RNeyAhpdZ2724Irc9S49pujisrJix0tnY=",
"A/YocdKgJEilqKgkHuM2q+HCvpJRac5PfaSJyQdvNck=",
"BhKjDKngehkrKHhWQB9LTYviTlu12MSJ2nTCXKjgB1k="
]
}
}
}