> For the complete documentation index, see [llms.txt](https://service.block-pro.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://service.block-pro.net/mainnet/starknet/validator.md).

# Validator & Attestation

Register a Starknet Mainnet validator and run attestations.

**Mainnet · staking and block attestations**

A synchronized Pathfinder node is the prerequisite. Validator onboarding also needs three deployed accounts: staker, rewards and operational. Install [Starknet Foundry sncast](https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html), configure the staker account, and fund the operational account for attestation fees. Keep the staker key offline when possible.

The official tutorial demonstrates Sepolia. The commands below explicitly target **Mainnet**. Verify contract addresses against [Starknet chain information](https://docs.starknet.io/learn/cheatsheets/chain-info) before signing. The reviewed minimum is **20,000 STRK**, plus transaction fees. Recheck the current minimum stake in [staking specifications](https://docs.starknet.io/learn/protocol/staking) rather than assuming the tutorial’s sample amount is sufficient.

### Set contract addresses

Use the contracts for this network.

```bash
STAKING_CONTRACT=0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7
STRK_CONTRACT=0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d
```

### Set your accounts

Replace each value with a deployed account address on this network.

```bash
STAKING_ADDRESS="YOUR_STAKER_ADDRESS"
REWARDS_ADDRESS="YOUR_REWARDS_ADDRESS"
OPERATIONAL_ADDRESS="YOUR_OPERATIONAL_ADDRESS"
```

### Choose the stake

Set the amount in base units: 1 STRK is 10^18 units. Enter an amount meeting the current minimum.

```bash
read -rp "Stake amount in STRK base units: " STAKE_AMOUNT
```

### Approve the transfer

Authorize only the chosen amount for the staking contract.

```bash
sncast --account staker invoke --network mainnet \
  --contract-address "$STRK_CONTRACT" --function approve \
  --arguments "$STAKING_CONTRACT,$STAKE_AMOUNT"
```

### Stake

Wait for approval to succeed, then lock the selected amount.

```bash
sncast --account staker invoke --network mainnet \
  --contract-address "$STAKING_CONTRACT" --function stake \
  --arguments "$REWARDS_ADDRESS,$OPERATIONAL_ADDRESS,$STAKE_AMOUNT"
```

### Set commission

This example sets 1% (100 of 10,000). Choose your rate before submitting.

```bash
sncast --account staker invoke --network mainnet --contract-address "$STAKING_CONTRACT" --function set_commission --arguments 100
```

### Open STRK delegation

Allow delegators to use your STRK pool.

```bash
sncast --account staker invoke --network mainnet --contract-address "$STAKING_CONTRACT" --function set_open_for_delegation --arguments "$STRK_CONTRACT"
```

### Verify registration

Check the returned account, stake and pool information.

```bash
sncast call --network mainnet --contract-address "$STAKING_CONTRACT" --function get_staker_info_v1 --arguments "$STAKING_ADDRESS"
```

The local signer requires a compatible deployed operational account without additional guardian or hardware-signing requirements. Use a dedicated operational account; keep your staker account’s custody setup intact.

## Run the attestation service

The attestation tool signs with the operational account and talks to your own synchronized Pathfinder RPC. Its current source requires JSON-RPC 0.10; use the versioned endpoint below.

### Open the node directory

Keep the attestation environment next to the node configuration.

```bash
cd "$HOME/pathfinder-mainnet"
```

### Enter the operational private key

Enter only the operational key; the prompt hides input.

```bash
read -rsp "Operational private key: " OPERATIONAL_PRIVATE_KEY; printf "\n"
```

### Store it privately

Create a restricted environment file. Do not share this file.

```bash
(umask 077; printf 'VALIDATOR_ATTESTATION_OPERATIONAL_PRIVATE_KEY=%s\n' "$OPERATIONAL_PRIVATE_KEY" > attestation.env)
```

### Clear the temporary key

Remove the key from the current shell variable.

```bash
unset OPERATIONAL_PRIVATE_KEY
```

### Pull the attestation image

Download the reviewed release.

```bash
sudo docker pull ghcr.io/software-mansion/starknet-validator-attestation:v0.5.2
```

### Check supported options

Check release options and RPC requirements before starting.

```bash
sudo docker run --rm ghcr.io/software-mansion/starknet-validator-attestation:v0.5.2 --help
```

### Start attestations

The host network lets the service reach your localhost Pathfinder endpoint.

```bash
sudo docker run -d --name attest-mainnet --restart unless-stopped \
  --network host --env-file "$HOME/pathfinder-mainnet/attestation.env" \
  --log-opt max-size=20m --log-opt max-file=5 \
  ghcr.io/software-mansion/starknet-validator-attestation:v0.5.2 \
  --staking-contract-address 0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7 \
  --attestation-contract-address 0x10398fe631af9ab2311840432d507bf7ef4b959ae967f1507928f5afe888a99 \
  --staker-operational-address "$OPERATIONAL_ADDRESS" \
  --node-url http://127.0.0.1:9545/rpc/v0_10 \
  --metrics-address 127.0.0.1:9090 \
  --local-signer
```

### Verify confirmed attestations

Look for confirmed transactions, not just a running container.

```bash
sudo docker logs --tail 100 -f attest-mainnet
```

Monitor the operational STRK balance, node lag and missed epochs. Docker administrators can read container environment variables; use the tool’s remote signer option if your custody design requires it.

[Validator onboarding](https://docs.starknet.io/secure/quickstart/becoming-a-validator) · [Attestation quickstart](https://docs.starknet.io/secure/quickstart/attesting-to-blocks) · [Attestation tool](https://github.com/software-mansion/starknet-validator-attestation).
