> For the complete documentation index, see [llms.txt](https://docs.kiln.fi/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kiln.fi/v1/kiln-products/onchain/deprecated-dedicated-validators/how-to-integrate/1.-contract-interactions.md).

# 1. Contract Interactions

## How to stake?

To stake, it is required to deposit any multiple of 32 ETH to the Staking Contract. The deposited ETH will be used by the Staking Contract to fund available validation keys registered by the Operator(s). There is 2 ways to do this:

1. Transfer the multiple of 32 ETH to the Staking Contract address
2. Call the `deposit()` function of the Staking Contract

Both will fund the validators by depositing them on the official Staking Contract and will set the owner of the validator in the Contract to the wallet which signed the deposit or transfer transaction.

{% hint style="warning" %}
Due to gas cost limitation, it is not recommended to deposit more than 40 validators (ie more than 1280 ETH) at once.
{% endhint %}

## How to claim rewards?

A validator(s) owner can claim the accrued EL and CL (Post-Shanghai) rewards on the Staking contract for its validator(s). When withdrawing available rewards, the commission dispatch is performed to the different partners defined in the contract (globalFee and operatorFee).&#x20;

1. `withdrawCLFee(bytes _publicKey)` performs commission dispatching on the available CL Recipient balance of the validator (accrued through EL fees earn when a block is proposed with or without MEV) and sends the rest to the validator owner. Pre-Shanghai this function reverts.
2. `withdrawELFee(bytes _publicKey)` performs commission dispatching on the available EL Recipient balance of the validator (accrued through EL fees earn when a block is proposed with or without MEV) and sends the rest to the validator owner.
3. `withdraw()` performs both of the above (reverts pre-Shanghai)

These 3 functions can be called by SYS\_ADMIN or the validator owner, the net available rewards will always go to the registered validator owner.

## \[Optional] How to change owner of a validator?

{% hint style="info" %}
This feature is disabled by default and must be enabled by SYS\_ADMIN using `setWithdrawerCustomizationEnabled(true)`
{% endhint %}

The owner of a validator can transfer its ownership to an other address if this feature is enabled by SYS\_ADMIN. This can be done by calling the following function from the validator owner wallet:

* `setWithdrawer(validatorPubkey, newOwner)`

After this call, `newOwner` will be the recipient of redeemed net rewards of the validator `validatorPubkey` and the only wallet able to trigger the exit of the validator.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kiln.fi/v1/kiln-products/onchain/deprecated-dedicated-validators/how-to-integrate/1.-contract-interactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
