> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gnosispay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# About GP Safe

> Gnosis Pay's on-chain infrastructure is built on top of the [Safe protocol](https://safe.global), providing a secure and programmable foundation for digital payments. Each user gets a unique Safe account that acts as their on-chain wallet, with additional modules that enable spending limits, time delays, and delegated spending capabilities.

The Gnosis Pay Safe consists of a core Safe account with three main modules attached:

1. **Core Safe Account**: The base Safe that holds funds and manages ownership
2. **Delay Module**: Controls transaction timing and provides security delays
3. **Roles Module**: Manages spending permissions and allowance limits
4. **Bouncer Module**: Handles account access validation and security

### Gnosis Pay Safe Setup Process

To understand how a Gnosis Pay Safe differs from a standard Safe, let's examine the [account setup flow](https://github.com/gnosispay/account-kit/blob/main/src/entrypoints/accounts-actions/accountSetup.ts#L88) that transforms a basic 1/1 Safe into a fully configured Gnosis Pay Safe Account:

<Steps titleSize="h3">
  <Step title="Safe Configuration">
    * **Ownership Transfer**: Swaps the Safe owner to an inaccessible address (`0x0000000000000000000000000000000000000002`)
    * **Module Enablement**: Enables both the Roles and Delay modules on the Safe
  </Step>

  <Step title="Delay Module Setup">
    * **Deployment**: Creates a new Delay module instance for the account
    * **Cooldown Configuration**: Sets the transaction delay period (typically 3 minutes)
    * **Expiration Setting**: Configures how long queued transactions remain valid
    * **Owner Access**: Grants the initial Safe owner (the owner before the ownership transfer) access to the delay module
  </Step>

  <Step title="Roles Module Setup">
    * **Deployment**: Creates a new Roles module instance for the account
    * **Allowance Configuration**: Sets up spending limits with:
      * Initial balance amount
      * Maximum balance cap
      * Refill amount per period
      * Time period for refills
    * **Role Assignment**: Grants spending permissions to designated spender addresses
    * **Target Scoping**: Restricts spending to specific token contracts
    * **Function Scoping**: Limits operations to ERC20 transfer functions only
    * **Ownership Transfer**: Transfers control to the Bouncer module
  </Step>

  <Step title="Bouncer Module">
    * **Deployment**: Creates the final security layer
    * **Access Control**: Manages who can interact with the account
  </Step>
</Steps>

### Spending Control Flow

The spending process follows this pattern:

1. **Spender Request**: A designated spender requests a transaction
2. **Allowance Check**: The Roles module verifies spending limits
3. **Delay Enforcement**: If limits allow, the transaction enters the delay queue
4. **Time Delay**: The transaction waits for the configured cooldown period
5. **Execution**: After the delay, the transaction can be executed
6. **Balance Update**: The allowance balance is updated accordingly
