> For the complete documentation index, see [llms.txt](https://tron-energy.gitbook.io/tronzap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tron-energy.gitbook.io/tronzap/learning-hub/resource-delegation.md).

# Resource Delegation

## Overview

Resource delegation allows one TRON account to provide Bandwidth or Energy to another account without transferring TRX. This is a core feature of Stake 2.0 and the mechanism that powers services like TronZap.

## How Delegation Works

* A staker locks TRX via Stake 2.0 to obtain resources
* Instead of using those resources themselves, the staker can delegate them to any other TRON address
* The recipient account can then use the delegated resources for transactions
* The staker retains ownership of the staked TRX — only the resource usage rights are transferred
* Delegation is performed via the `delegateresource` system contract
* To reclaim delegated resources, the staker calls `undelegateresource`

## Delegation Parameters

* **Resource type:** BANDWIDTH or ENERGY
* **Receiver address:** the TRON address that will receive the resources
* **Amount:** specified in TRX (the system converts this to the corresponding resource amount)
* **Lock period (optional):** if set, the delegation cannot be revoked for the specified duration
* When the lock period expires, the staker can undelegate at any time

## Use Cases

* **Energy rental services (like TronZap):** stake large pools of TRX, delegate Energy to paying users for a set duration, then reclaim it
* **Subsidizing user transactions:** DApps can delegate resources to their users so they don't need to hold TRX
* **Team/organization resource sharing:** a treasury account stakes TRX and delegates resources to operational wallets

## How TronZap Uses Delegation

* TronZap maintains a pool of staked TRX generating Energy
* When a user pays for energy rental, TronZap automatically delegates the requested amount of Energy to the user's address
* The delegation typically lasts for 1 hour (for direct recharge) or as specified by the subscription
* After the period expires, the Energy is reclaimed and returned to the pool
* This model is more cost-effective for users than staking TRX themselves, because: (a) no capital lock-up, (b) no 14-day unstaking wait, (c) pay only for what you need

## Delegation Flow

```mermaid
sequenceDiagram
    participant TronZap
    participant TRON Network
    participant User

    TronZap->>TRON Network: Stakes TRX
    TRON Network->>TronZap: Obtains Energy pool
    User->>TronZap: Pays rental fee
    TronZap->>TRON Network: Delegates Energy to User's address
    TRON Network->>User: Energy delegated
    User->>TRON Network: Executes TRC20 transfers (Energy consumed instead of TRX burned)
    Note over User,TRON Network: Delegation period expires
    TronZap->>TRON Network: Reclaims Energy
    TRON Network->>TronZap: Energy regenerates in pool
```

## Related Pages

* [Staking TRX](/tronzap/learning-hub/staking-trx.md)
* [TRON Resource Model](/tronzap/learning-hub/tron-resource-model.md)
* [What is TronZap](/tronzap/introduction/what-is-tronzap.md)
