Create SSV Request
Set up a request for running a distributed validator and making a stake.
curl --request POST \
--url https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"ssvOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"type": "without-encrypt-key",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"operationPeriodInDays": 365,
"ecdhPublicKey": null
}
'import requests
url = "https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create"
payload = {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"ssvOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"type": "without-encrypt-key",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"operationPeriodInDays": 365,
"ecdhPublicKey": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
validatorsCount: 1,
withdrawalAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
feeRecipientAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
ssvOwnerAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
type: 'without-encrypt-key',
amountPerValidator: '32000000000',
withdrawalCredentialsType: '0x02',
operationPeriodInDays: 365,
ecdhPublicKey: null
})
};
fetch('https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3fa85f64-5717-4562-b3fc-2c963f66afa6',
'validatorsCount' => 1,
'withdrawalAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'feeRecipientAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'ssvOwnerAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'type' => 'without-encrypt-key',
'amountPerValidator' => '32000000000',
'withdrawalCredentialsType' => '0x02',
'operationPeriodInDays' => 365,
'ecdhPublicKey' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create"
payload := strings.NewReader("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"ssvOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"type\": \"without-encrypt-key\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"operationPeriodInDays\": 365,\n \"ecdhPublicKey\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"ssvOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"type\": \"without-encrypt-key\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"operationPeriodInDays\": 365,\n \"ecdhPublicKey\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"ssvOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"type\": \"without-encrypt-key\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"operationPeriodInDays\": 365,\n \"ecdhPublicKey\": null\n}"
response = http.request(request)
puts response.read_body"<unknown>"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Arbitrary UUID. You can later use that UUID to check the status of the set-up operation.
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
Number of validators. One validator is equal to 32 ETH.
1 <= x <= 501
Withdrawal address of the client.
^0x[a-fA-F0-9]{40}$"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb"
Eth1 address that receives fee recipient rewards.
^0x[a-fA-F0-9]{40}$"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb"
ETH1 address from which registerValidator method of SSV contract will be called.
^0x[a-fA-F0-9]{40}$"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb"
Request type: with or without an encrypted key. If with-encrypt-key is selected, fill the ecdhPublicKey field.
with-encrypt-key, without-encrypt-key "without-encrypt-key"
Amount of tokens in Gwei to stake per validator.
"32000000000"
Withdrawal credentials type.
0x01, 0x02 "0x02"
Operation period in days.
1 <= x <= 3650365
Your ECDH public key for getting the encrypted validator private key.
null
Response
OK
The response is of type any.
curl --request POST \
--url https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"ssvOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"type": "without-encrypt-key",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"operationPeriodInDays": 365,
"ecdhPublicKey": null
}
'import requests
url = "https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create"
payload = {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"validatorsCount": 1,
"withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"feeRecipientAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"ssvOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"type": "without-encrypt-key",
"amountPerValidator": "32000000000",
"withdrawalCredentialsType": "0x02",
"operationPeriodInDays": 365,
"ecdhPublicKey": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
validatorsCount: 1,
withdrawalAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
feeRecipientAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
ssvOwnerAddress: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
type: 'without-encrypt-key',
amountPerValidator: '32000000000',
withdrawalCredentialsType: '0x02',
operationPeriodInDays: 365,
ecdhPublicKey: null
})
};
fetch('https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3fa85f64-5717-4562-b3fc-2c963f66afa6',
'validatorsCount' => 1,
'withdrawalAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'feeRecipientAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'ssvOwnerAddress' => '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb',
'type' => 'without-encrypt-key',
'amountPerValidator' => '32000000000',
'withdrawalCredentialsType' => '0x02',
'operationPeriodInDays' => 365,
'ecdhPublicKey' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create"
payload := strings.NewReader("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"ssvOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"type\": \"without-encrypt-key\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"operationPeriodInDays\": 365,\n \"ecdhPublicKey\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"ssvOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"type\": \"without-encrypt-key\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"operationPeriodInDays\": 365,\n \"ecdhPublicKey\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/eth/staking/ssv/request/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"validatorsCount\": 1,\n \"withdrawalAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"feeRecipientAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"ssvOwnerAddress\": \"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb\",\n \"type\": \"without-encrypt-key\",\n \"amountPerValidator\": \"32000000000\",\n \"withdrawalCredentialsType\": \"0x02\",\n \"operationPeriodInDays\": 365,\n \"ecdhPublicKey\": null\n}"
response = http.request(request)
puts response.read_body"<unknown>"