Ethereum Beacon — ValidatorRequiredApi (2/3)
API reference for Ethereum Beacon. All methods ->
POST /eth/v1/beacon/pool/attestations
Submits Attestation objects to the node.
Submits Attestation objects to the node. Each attestation in the request body is processed individually.
If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet.
If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why.
Parameters
<request body>(required):
[
{
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
}
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attestations" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'
Responses
Code 200: Attestations are stored in pool and broadcast on appropriate subnet.Code 400: Errors with one or more attestations.
{
"code": 400,
"message": "some failures",
"failures": [
{
"index": 3,
"message": "invalid signature"
}
]
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
POST /eth/v1/beacon/pool/sync_committees
Submits sync committee signatures to the node.
Submits sync committee signature objects to the node.
Sync committee signatures are not present in phase0, but are required for Altair networks.
If a sync committee signature is validated successfully the node MUST publish that sync committee signature on all applicable subnets.
If one or more sync committee signatures fail validation the node MUST return a 400 error with details of which sync committee signatures have failed, and why.
Parameters
<request body>(required):
[
{
"slot": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"validator_index": "1",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/sync_committees" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'
Responses
Code 200: Sync committee signatures are stored in pool and broadcast on appropriate subnet.Code 400: Errors with one or more sync committee signatures.
{
"code": 400,
"message": "some failures",
"failures": [
{
"index": 3,
"message": "invalid signature"
}
]
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/node/syncing
Retrieves a node syncing status.
Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to.
Parameters
None.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/syncing" \
-H "Accept: application/json"
Responses
Code 200: Success.
{
"data": {
"head_slot": "1",
"sync_distance": "1",
"is_syncing": true,
"is_optimistic": true
}
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/config/spec
Retrieves spec parameters.
Retrieve specification configuration used on this node. The configuration should include:
- Constants for all hard forks known by the beacon node, for example the phase 0 and altair values.
- Presets for all hard forks supplied to the beacon node, for example the phase 0 and altair values.
- Configuration for the beacon node, for example the mainnet values.
Values are returned with the following format:
- Any value starting with 0x in the spec is returned as a hex string.
- Numeric values are returned as a quoted integer.
Parameters
None.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/config/spec" \
-H "Accept: application/json"
Responses
Code 200: Success.
{
"DEPOSIT_CONTRACT_ADDRESS": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
"DEPOSIT_NETWORK_ID": "1",
"DOMAIN_AGGREGATE_AND_PROOF": "0x06000000",
"INACTIVITY_PENALTY_QUOTIENT": "67108864",
"INACTIVITY_PENALTY_QUOTIENT_ALTAIR": "50331648"
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
POST /eth/v1/validator/duties/attester/{epoch}
Retrieves attester duties.
Requests the beacon node to provide a set of attestation duties, which should be performed by validators, for a particular epoch. Duties should only need to be checked once per epoch, however a chain reorganization (of > MIN_SEED_LOOKAHEAD epochs) could occur, resulting in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches:
- event.previous_duty_dependent_root when
compute_epoch_at_slot(event.slot) == epoch - event.current_duty_dependent_root when
compute_epoch_at_slot(event.slot) + 1 == epoch - event.block otherwise
The dependent_root value is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1) or the genesis block root in the case of underflow.
Parameters
epoch(string; path; required): should only be allowed one epoch ahead.<request body>(required): an array of the validator indices for which to obtain the duties:
[
"1"
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/attester/{epoch}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'
Responses
Code 200: Success.
{
"dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"execution_optimistic": false,
"data": [
{
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
"validator_index": "1",
"committee_index": "1",
"committee_length": "1",
"committees_at_slot": "1",
"validator_committee_index": "1",
"slot": "1"
}
]
}
Code 400: Invalid epoch or index.
{
"code": 400,
"message": "Invalid epoch: -2"
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
Code 503: Beacon node is currently syncing, try again later.
{
"code": 503,
"message": "Beacon node is currently syncing and not serving request on that endpoint"
}
GET /eth/v1/validator/duties/proposer/{epoch}
Retrieves block proposer duties.
Request beacon node to provide all validators that are scheduled to propose a block in the given epoch. Duties should only need to be checked once per epoch, however a chain reorganization could occur that results in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches:
- event.current_duty_dependent_root when
compute_epoch_at_slot(event.slot) == epoch - event.block otherwise
The dependent_root value is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1) or the genesis block root in the case of underflow.
Parameters
epoch(string; path; required); an epoch.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/proposer/{epoch}" \
-H "Accept: application/json"
Responses
Code 200: Success.
{
"dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"execution_optimistic": false,
"data": [
{
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
"validator_index": "1",
"slot": "1"
}
]
}
Code 400: Invalid epoch.
{
"code": 400,
"message": "Invalid epoch: -2"
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
Code 503: Beacon node is currently syncing, try again later.
{
"code": 503,
"message": "Beacon node is currently syncing and not serving request on that endpoint"
}
POST /eth/v1/validator/duties/sync/{epoch}
Retrieves sync committee duties.
Requests the beacon node to provide a set of sync committee duties for a particular epoch.
Parameters
epoch(string; path; required):epoch//EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch//EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1<request body>(required): an array of the validator indices for which to obtain the duties:
[
"1"
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/sync/{epoch}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'
Responses
Code 200: Success.
{
"execution_optimistic": false,
"data": [
{
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
"validator_index": "1",
"validator_sync_committee_indices": [
"1"
]
}
]
}
Code 400: Invalid epoch or index.
{
"code": 400,
"message": "Invalid epoch: -2"
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
Code 503: Beacon node is currently syncing, try again later.
{
"code": 503,
"message": "Beacon node is currently syncing and not serving request on that endpoint"
}
GET /eth/v3/validator/blocks/{slot}
Produces a new block, without signature.
Requests a beacon node to produce a valid block, which can then be signed by a validator. The returned block may be blinded or unblinded, depending on the current state of the network as decided by the execution and beacon nodes.
The beacon node must return an unblinded block if it obtains the execution payload from its paired execution node. It must only return a blinded block if it obtains the execution payload header from an MEV relay.
Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress.
Parameters
slot(string; path; required): the slot for which the block should be proposed.randao_reveal(string; hex; query; required): the validator's randao reveal value.graffiti(string; hex; query): an arbitrary data validator to include in the block.skip_randao_verification(query): skip verification of therandao_revealvalue. If this flag is set then therandao_revealmust be set to the point at infinity (0xc0..00). This query parameter is a flag and does not take a value.builder_boost_factor(string; query):
percentage multiplier to apply to the builder's payload value when choosing between a builder payload header and payload from the paired execution node. This parameter is only relevant if the beacon node is connected to a builder, deems it safe to produce a builder payload, and receives valid responses from both the builder endpoint and the paired execution node. When these preconditions are met, the server MUST act as follows:
- if
exec_node_payload_value >= builder_boost_factor * (builder_payload_value // 100), then return a full (unblinded) block containing the execution node payload. - otherwise, return a blinded block containing the builder payload header.
Servers must support the following values of the boost factor which encode common preferences:
builder_boost_factor=0: prefer the execution node payload unless an error makes it unviable.builder_boost_factor=100: default profit maximization mode; choose whichever payload pays more.builder_boost_factor=2**64 - 1: prefer the builder payload unless an error or beacon node health check makes it unviable.
Servers should use saturating arithmetic or another technique to ensure that large values of the builder_boost_factor do not trigger overflows or errors. If this parameter is provided and the beacon node is not configured with a builder then the beacon node MUST respond with a full block, which the caller can choose to reject if it wishes. If this parameter is not provided then it should be treated as having the default value of 100. If the value is provided but out of range for a 64-bit unsigned integer, then an error response with status code 400 MUST be returned.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v3/validator/blocks/{slot}" \
-H "Accept: application/json"
Responses
Code 200: Success.
Note: The Eth-Consensus-Version, Eth-Execution-Payload-Blinded, Eth-Execution-Payload-Value, Eth-Consensus-Block-Value header is required in response so client can deserialize returned json or ssz data more effectively.
{
"version": "phase0",
"data": {
"slot": "1",
"proposer_index": "1",
"parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"body": {
"randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"eth1_data": {
"deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"deposit_count": "1",
"block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"graffiti": "0xbF0eF8805DE094355C99fD34Df183ADB5BB153f5dac2eD83bee6eEd2dEf05cFC",
"proposer_slashings": [
{
"signed_header_1": {
"message": {
"slot": "1",
"proposer_index": "1",
"parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
},
"signed_header_2": {
"message": {
"slot": "1",
"proposer_index": "1",
"parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
}
],
"attester_slashings": [
{
"attestation_1": {
"attesting_indices": [
"1"
],
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
},
"attestation_2": {
"attesting_indices": [
"1"
],
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
}
}
],
"attestations": [
{
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
}
],
"deposits": [
{
"proof": [
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
],
"data": {
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
"withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"amount": "1",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
}
],
"voluntary_exits": [
{
"message": {
"epoch": "1",
"validator_index": "1"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]
}
}
}
Code 400: Invalid block production request.
{
"code": 400,
"message": "Invalid request to produce a block"
}
Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
Code 503: Beacon node is currently syncing, try again later.
{
"code": 503,
"message": "Beacon node is currently syncing and not serving request on that endpoint"
}