Ethereum Beacon — ValidatorRequiredApi (3/3)
API reference for Ethereum Beacon. All methods ->
GET /eth/v1/validator/attestation_data
Produces attestation data.
Requests that the beacon node produce an AttestationData.
A 503 error must be returned if the block identified by the response beacon_block_root is optimistic (i.e. the attestation attests to a block that has not been fully verified by an execution engine).
Parameters
slot(string; query; required): the slot for which an attestation data should be created.committee_index(string; query; required): the committee index for which an attestation data should be created.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/attestation_data" \
-H "Accept: application/json"
Responses
Code 200: Success.
{
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
}
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"
}
GET /eth/v1/validator/aggregate_attestation
Retrieves aggregated attestation.
Aggregates all attestations matching given attestation data root and slot.
A 503 error must be returned if the block identified by the response beacon_block_root is optimistic (i.e. the aggregated attestation attests to a block that has not been fully verified by an execution engine).
A 404 error must be returned if no attestation is available for the requested attestation_data_root.
Parameters
attestation_data_root(string, hex; query; required): HashTreeRoot of AttestationData that validator wants aggregated.slot(string; query; required): a slot.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_attestation" \
-H "Accept: application/json"
Responses
Code 200: Success. Returns aggregatedAttestationobject with sameAttestationDataroot.
{
"data": {
"aggregation_bits": "0x01",
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"data": {
"slot": "1",
"index": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"source": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"target": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
}
}
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"
}
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>(required):
[
{
"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>(required):
[
{
"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"
}
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, hex; 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/contribution_and_proofs
Publishes multiple contribution and proofs.
Publishes multiple signed sync committee contribution and proofs.
Parameters
<request body>(required):
[
{
"message": {
"aggregator_index": "1",
"selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
"contribution": {
"slot": "1",
"beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"subcommittee_index": "1",
"aggregation_bits": "0x01",
"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>(required):
[
{
"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"
}