For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Ethereum Beacon — Validator, ValidatorRequiredApi

API reference for Ethereum Beacon. All methods ->

POST /eth/v1/validator/aggregate_and_proofs

Publishes multiple aggregate and proofs.

Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.

Parameters

  • <request body> (required):
[
{
"message": {
"aggregator_index": "1",
"aggregate": {
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
},
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_and_proofs" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • Code 200: Success.
  • Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

POST /eth/v1/validator/beacon_committee_subscriptions

Signals the Beacon node to prepare for a committee subnet.

After beacon node receives this request, search using discv5 for peers related to this subnet and replace current peers with those ones if necessary. If validator is_aggregator, beacon node must:

  • Announce subnet topic subscription on gossipsub.
  • Aggregate attestations received on that subnet.

Parameters

  • <request body>:
[
{
"validator_index": "1",
"committee_index": "1",
"committees_at_slot": "1",
"slot": "1",
"is_aggregator": true
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_subscriptions" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • Code 200: Success. Slot signature is valid and beacon node has prepared the attestation subnet. Note that we cannot be certain the Beacon node will find peers for that subnet for various reasons.

  • Code 400: Invalid request syntax.

{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • 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/sync_committee_subscriptions

Subscribes to sync committee subnets.

Subscribe to a number of sync committee subnets.

Sync committees are not present in phase0, but are required for Altair networks.

Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee.

Parameters

  • <request body>:
[
{
"validator_index": "1",
"sync_committee_indices": [
"1"
],
"until_epoch": "1"
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_subscriptions" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • Code 200: Success.
  • Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

POST /eth/v1/validator/beacon_committee_selections

Determines if a distributed validator has been selected to aggregate attestations.

This endpoint should be used by a validator client running as part of a distributed validator cluster, and is implemented by a distributed validator middleware client. This endpoint is used to exchange partial selection proofs for combined/aggregated selection proofs to allow a validator client to correctly determine if any of its validators has been selected to perform an attestation aggregation duty in a slot. Validator clients running in a distributed validator cluster must query this endpoint at the start of an epoch for the current and lookahead (next) epochs for all validators that have attester duties in the current and lookahead epochs. Consensus clients need not support this endpoint and may return a 501.

Parameters

  • <request body> (required):
[
{
"validator_index": "1",
"slot": "1",
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_selections" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • 200: Returns the threshold aggregated beacon committee selection proofs.
{
"data": [
{
"validator_index": "1",
"slot": "1",
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]
}
  • 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
  • 501: Endpoint not implemented.
{
"code": 501,
"message": "Endpoint not implemented"
}
  • 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/sync_committee_contribution

Produces a sync committee contribution.

Requests that the beacon node produce a sync committee contribution.

A 503 error must be returned if the block identified by the response beacon_block_root is optimistic (i.e. the sync committee contribution refers to a block that has not been fully verified by an execution engine).

Parameters

  • slot (string; query; required): the slot for which a sync committee contribution should be created.
  • subcommittee_index (string; query; required): the subcommittee index for which to produce the contribution.
  • beacon_block_root (string; query; required): the block root for which to produce the contribution.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_contribution" \
-H "Accept: application/json"

Responses

  • Code 200: Success.
{
"data": {
"slot": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"subcommittee_index": "1",
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
}
  • Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • Code 404: Not found.
{
"code": 404,
"message": "Requested item not found"
}
  • 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/sync_committee_selections

Determines if a distributed validator has been selected to make a sync committee contribution.

Submit sync committee selections to a DVT middleware client. It returns the threshold aggregated sync committee selection. This endpoint should be used by a validator client running as part of a distributed validator cluster, and is implemented by a distributed validator middleware client. This endpoint is used to exchange partial selection proofs (slot signatures) for combined/aggregated selection proofs to allow a validator client to correctly determine if any of its validators has been selected to perform a sync committee contribution (sync aggregation) duty in a slot. Validator clients running in a distributed validator cluster must query this endpoint at the start of each slot for all validators that are included in the current sync committee. Consensus clients need not support this endpoint and may return a 501.

Parameters

  • <request body> (required):
[
{
"validator_index": "1",
"slot": "1",
"subcommittee_index": "1",
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_selections" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • 200: Returns the threshold aggregated sync committee selection proofs.
{
"data": [
{
"validator_index": "1",
"slot": "1",
"subcommittee_index": "1",
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]
}
  • 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
  • 501: Endpoint not implemented.
{
"code": 501,
"message": "Endpoint not implemented"
}
  • 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/contribution_and_proofs

Publishes multiple contribution and proofs.

Publishes multiple signed sync committee contribution and proofs.

Parameters

  • <request body>:
[
{
"message": {
"aggregator_index": "1",
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"contribution": {
"slot": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"subcommittee_index": "1",
"aggregation_bits": "0xffffffffffffffffffffffffffffffff",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/contribution_and_proofs" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • Code 200: Success.
  • Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

POST /eth/v1/validator/prepare_beacon_proposer

Provides the Beacon node with proposals for the given validators.

Prepares the beacon node for potential proposers by supplying information required when proposing blocks for the given validators. The information supplied for each validator index will persist through the epoch in which the call is submitted and for a further two epochs after that, or until the beacon node restarts. It is expected that validator clients will send this information periodically, for example each epoch, to ensure beacon nodes have correct and timely fee recipient information.

Note that there is no guarantee that the beacon node will use the supplied fee recipient when creating a block proposal, so on receipt of a proposed block the validator should confirm that it finds the fee recipient within the block acceptable before signing it.

Also note that requests containing currently inactive or unknown validator indices will be accepted, as they may become active at a later epoch.

Parameters

  • <request body>:
[
{
"validator_index": "1",
"fee_recipient": "0xAbcF8e0d4e9587369b2301D0790347320302cc09"
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/prepare_beacon_proposer" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • Code 200: Success. Preparation information has been received.
  • Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

POST /eth/v1/validator/register_validator

Provides the Beacon node with registrations for the given validators to the external builder network.

Prepares the beacon node for engaging with external builders. The information must be sent by the beacon node to the builder network. It is expected that the validator client will send this information periodically to ensure the beacon node has correct and timely registration information to provide to builders. The validator client should not sign blinded beacon blocks that do not adhere to their latest fee recipient and gas limit preferences.

Note that only registrations for active or pending validators must be sent to the builder network. Registrations for unknown or exited validators must be filtered out and not sent to the builder network.

Parameters

  • <request body>:
[
{
"message": {
"fee_recipient": "0xAbcF8e0d4e9587369b2301D0790347320302cc09",
"gas_limit": "1",
"timestamp": "1",
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/register_validator" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • Code 200: Success. Registration information has been received.
  • Code 400: Invalid request syntax.
{
"code": 400,
"message": "string",
"stacktraces": [
"string"
]
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

POST /eth/v1/validator/liveness/{epoch}

Indicates if a validator has been observed on the network.

Requests the beacon node to indicate if a validator has been observed to be live in a given epoch. The beacon node might detect liveness by observing messages from the validator on the network, in the beacon chain, from its API or from any other source. A beacon node SHOULD support the current and previous epoch, however it MAY support earlier epoch. It is important to note that the values returned by the beacon node are not canonical; they are best-effort and based upon a subjective view of the network. A beacon node that was recently started or suffered a network partition may indicate that a validator is not live when it actually is.

Parameters

  • epoch (string; path; required): the epoch for which liveness is being queried.
  • <request body> (required): an array of the validator indices for which to detect liveness.
[
"1"
]

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/liveness/{epoch}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{request body}'

Responses

  • 200: Success.
{
"data": [
{
"index": "1",
"is_live": true
}
]
}
  • 400: Invalid epoch or index.
{
"code": 400,
"message": "Invalid epoch: -2"
}
  • 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
  • 503: Beacon node is currently syncing, try again later.
{
"code": 503,
"message": "Beacon node is currently syncing and not serving request on that endpoint"
}

ValidatorRequiredApi

Minimal set of endpoints to enable a working validator implementation.

GET /eth/v1/beacon/genesis

Retrieves the details of the chain's genesis.

Returns the details of the chain's genesis which can be used to identify chain.

Parameters

None.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/genesis" \
-H "Accept: application/json"

Responses

  • 200: Success.
{
"data": {
"genesis_time": "1606824023",
"genesis_validators_root": "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95",
"genesis_fork_version": "0x00000000"
}
}
  • 404: Chain genesis info is not yet known.
{
"code": 404,
"message": "Chain genesis info is not yet known"
}
  • 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/beacon/states/{state_id}/fork

Retrieves the Fork object for a requested state.

Retrieves the Fork object for state with given 'stateId'.

Parameters

  • state_id (string; path; required): state identifier. Can be one of: head (canonical head in node's view), genesis, finalized, justified, <slot>, <hex encoded stateRoot with 0x prefix>.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/state/{state_id}/fork" \
-H "Accept: application/json"

Responses

  • 200: Success.
{
"execution_optimistic": false,
"data": {
"previous_version": "0x00000000",
"current_version": "0x00000000",
"epoch": "1"
}
}
  • 400: Invalid state ID.
{
"code": 400,
"message": "Invalid state ID: current"
}
  • 404: State not found.
{
"code": 404,
"message": "State not found"
}
  • 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}

Retrieves the validator from state by ID.

Returns validator specified by state and id or public key along with status and balance.

Parameters

  • state_id (string; path; required): state identifier. Can be one of: head (canonical head in node's view), genesis, finalized, justified, <slot>, <hex encoded stateRoot with 0x prefix>.
  • validator_id (string; path; required): either a hex encoded public key (any bytes48 with 0x prefix) or validator index.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators/{validator_id}" \
-H "Accept: application/json"

Responses

  • 200: Success.
{
"execution_optimistic": false,
"data": {
"index": "1",
"balance": "1",
"status": "active_ongoing",
"validator": {
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
"withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"effective_balance": "1",
"slashed": false,
"activation_eligibility_epoch": "1",
"activation_epoch": "1",
"exit_epoch": "1",
"withdrawable_epoch": "1"
}
}
}
  • 400: Invalid state or validator ID.
{
"code": 400,
"message": "Invalid state ID: current"
}
  • 404: Not found.
{
"code": 404,
"message": "State not found"
}
  • 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

POST /eth/v1/beacon/blocks

Publishes a signed block.

Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. A success response (20x) indicates that the block passed gossip validation and was successfully broadcast onto the network. The beacon node is also expected to integrate the block into state, but may broadcast it before doing so, thus to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was successfully broadcast but failed integration. After Deneb, this additionally instructs the beacon node to broadcast all given blobs.

Parameters

  • Eth-Consensus-Version (header): a version of the block being submitted, if using SSZ encoding. Available values : phase0, altair, bellatrix.
  • <request body> (required): the SignedBeaconBlock object composed of the BeaconBlock object (produced by beacon node) and validator signature.
{
"message": {
"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": "0xdEFeAFdc312b725d00Dd16b4A627fCBfa6B8aAF1d8AF7bCfd82bbFca700A0645",
"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"
}
]
}
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks" \
-H "Eth-Consensus-Version: bellatrix" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{your_request_body}'

Responses

  • Code 200: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database.

  • Code 202: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database.

  • Code 400: The SignedBeaconBlock object is invalid.

{
"code": 400,
"message": "Invalid block: missing signature"
}
  • Code 415: The supplied content-type is not supported.
{
"code": 415,
"message": "Cannot read the supplied content type."
}
  • 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/v2/beacon/blocks

Publishes a signed block.

Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. A success response (20x) indicates that the block passed gossip validation and was successfully broadcast onto the network. The beacon node is also expected to integrate the block into the state, but may broadcast it before doing so, thus to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was successfully broadcast but failed integration. After Deneb, this additionally instructs the beacon node to broadcast all given blobs. The broadcast behaviour may be adjusted via the broadcast_validation query parameter.

Parameters

  • broadcast_validation (string; query): Level of validation that must be applied to a block before it is broadcast. Possible values:
    • gossip (default): lightweight gossip checks only.
    • consensus: full consensus checks, including validation of all signatures and blocks fields except for the execution payload transactions.
    • consensus_and_equivocation: the same as consensus, with an extra equivocation check immediately before the block is broadcast. If the block is found to be an equivocation it fails validation.
  • Eth-Consensus-Version (header; required): a version of the block being submitted, if using SSZ encoding. Available values : phase0, altair, bellatrix, capella, deneb.
  • <request body> (required): the SignedBeaconBlock object composed of the BeaconBlock object (produced by beacon node) and validator signature.
{
"message": {
"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": "0xdEFeAFdc312b725d00Dd16b4A627fCBfa6B8aAF1d8AF7bCfd82bbFca700A0645",
"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"
}
]
}
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}

Request example

curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/beacon/blocks" \
-H "Eth-Consensus-Version: bellatrix" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{your_request_body}'

Responses

  • Code 200: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database.

  • Code 202: The block could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast.

  • Code 400: The SignedBeaconBlock object is invalid or broadcast validation failed.

{
"code": 400,
"message": "Invalid block: missing signature"
}
  • Code 415: The supplied content-type is not supported.
{
"code": 415,
"message": "Cannot read the supplied content type."
}
  • 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"
}