> For the complete documentation index, see [llms.txt](https://docs.idrx.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idrx.co/smart-contract/staking/claim-principal-and-staking-rewards.md). Agents can also search and read this documentation through its [MCP server](https://docs.idrx.co/~gitbook/mcp).

# Claim Principal and Staking Rewards

Once the staking duration is complete, users can claim their principal and any remaining rewards.

{% hint style="info" %}
Using an AI assistant or LLM? An index of these docs is available at [llms.txt](https://docs.idrx.co/llms.txt), and the full docs in one file at [llms-full.txt](https://docs.idrx.co/llms-full.txt).
{% endhint %}

* **Function**: `claimStakePrincipal(uint stakeId)`
* **Parameters**:
  * `stakeId`: The ID of the stake.
* **Event** **Emitted**:

```solidity
event withdrawPrincipal(
    uint stakeId,
    address staker,
    uint principalAmount,
    uint claimedTimestamp
);
```
