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

# Complete Employer Workflow: From Stream Setup to Payment

> How to create and fund a stream, share it with your freelancer, monitor work sessions, and approve or dispute payments on the Aven dashboard.

As an employer (stream sender) on Aven, you fund a smart-contract escrow, share a stream ID with your freelancer, and review verified work-session reports before payment is released. This page walks you through every stage of that journey — from connecting your wallet to the final attestation.

```mermaid theme={null}
flowchart TD
  A[Connect Freighter wallet] --> B[Navigate to /stream/create]
  B --> C[Fill in stream parameters]
  C --> D[Approve Freighter transaction]
  D --> E[Stream created — escrow funded]
  E --> F[Share stream ID with freelancer]
  F --> G[Monitor work sessions on /stream/id]
  G --> H{Work session submitted?}
  H -->|Yes| I[Review work report]
  I --> J{Decision}
  J -->|Approve| K[Approve withdrawal]
  K --> L[Contract releases payment]
  L --> M[Attestation minted]
  J -->|Dispute| N[Dispute withdrawal]
  N --> O[Resolution process]
  H -->|No| G
  M --> P{Stream complete?}
  P -->|Yes| Q[Stream ends]
  P -->|No| G
```

## Step-by-step guide

**1. Connect your Freighter wallet**

Open the [Aven dashboard](https://aven-chi.vercel.app/dashboard) and connect your [Freighter](https://www.freighter.app/) wallet. Make sure Freighter is configured for **Stellar testnet** — Aven currently operates on testnet only.

> [!NOTE]
>
> Aven never stores your wallet secret key. All transactions are signed locally in Freighter and broadcast to the Stellar network.

**2. Create a stream**

Navigate to [/stream/create](https://aven-chi.vercel.app/stream/create). The guided four-step form collects everything the smart contract needs to set up an escrow agreement.

Fill in each field:

| Field | Description |
| - | - |
| **Recipient address** | The Stellar public key of the freelancer who will do the work. |
| **Asset** | The payment asset — XLM or USDC (Stellar testnet). |
| **Rate per second** | How much the freelancer earns for each verified active second of work. |
| **Budget** | The total amount locked into escrow. The contract caps all payments to this ceiling. |
| **Duration** | The maximum calendar time the stream remains open. |
| **Category** | The type of work (e.g. development, design). Used for attestation metadata. |
| **Title** | A short human-readable label for the engagement. Visible to both parties on the stream page. |

> [!TIP]
>
> Set your rate per second carefully — the contract enforces the exact payment amount. Workers never enter their own payment figure; the calculation is `active seconds × rate`, capped by the remaining escrow.

**3. Fund the stream — approve the Freighter transaction**

After completing the form, Aven constructs a Stellar transaction that locks the full budget in the stream contract escrow. Freighter will prompt you to review and sign the transaction.

Once you sign, the stream is live and the escrow is funded. You will be redirected to the stream page at `/stream/[id]`.

**4. Share the stream ID with your freelancer**

Copy the stream ID from the stream page URL or the stream details panel and send it to your freelancer. They will need it when authorizing the `aven-stellar` CLI for the first time.

> [!NOTE]
>
> The stream ID is not sensitive — it is a public contract identifier. Anyone can view the stream's on-chain state, but only the designated recipient can submit work sessions.

**5. Monitor the stream page**

Visit `/stream/[id]` at any time to see the live state of the engagement:

* **Funding panel** — total budget, amount reserved for pending/approved sessions, and remaining unreserved escrow.
* **Work sessions tab** — all submitted sessions with their current status (`Pending`, `Reserved`, `Approved`, `Disputed`).
* **Active session indicator** — shows whether the freelancer has an active CLI session running right now.

No action is required from you while the freelancer is working. Check back when a session is submitted for your review.

**6. Review a submitted work session**

When the freelancer stops a session and submits it, it appears under the **WORK SESSIONS** tab on the stream page. Click any submitted session to expand the full report. You will see:

* **Active time** — the total tracked active seconds, minus idle periods detected by the watcher.
* **Git changes summary** — the branch, starting commit, ending commit, list of changed file paths (relative paths only — no file contents), additions count, and deletions count.
* **Delivery statement** — the freelancer's written summary of what was accomplished.
* **Payment amount** — the contract-calculated figure (`active seconds × rate`), capped by the remaining escrow. This number is enforced by the smart contract and cannot be altered manually.
* **Evidence hash** — a cryptographic commitment to the report data, which is included in the on-chain attestation.

> [!NOTE]
>
> The Aven verifier independently validates the payment calculation before reserving funds. You are approving the work itself — the contract always enforces the correct payment amount.

**7. Approve or dispute the session**

After reviewing, choose one of two actions:

**Approve**

* Calls `approve_withdrawal` on the stream contract.
* Immediately triggers `withdraw_approved`, transferring the reserved amount to the recipient's wallet.
* Mints a permanent on-chain attestation linking the work record to both addresses.

**Dispute**

* Changes the session's `WithdrawalStatus` to `Disputed`.
* Freezes the reserved funds in escrow — neither party can access them.
* Opens the resolution process (see the [Disputes guide](https://aven-docs.mintlify.site/workflows/disputes.md)).

> [!WARNING]
>
> If you neither approve nor dispute within the configured timeout period, the `finalize_timeout` path can be called and payment will release automatically. Act promptly to retain control over the decision.

**8. Payment is released automatically on approval**

Once you approve, the contract executes the fund transfer without any further interaction. The payment appears in the recipient's Freighter wallet and a verifiable attestation is minted on-chain.

The stream remains open for additional sessions until the budget is exhausted, the duration expires, or you cancel it.

***

## Stream management

After a stream is live you can perform additional management actions from the stream page:

> **Pause**
>
> Temporarily suspends the stream. The freelancer's CLI will not be able to submit new sessions while the stream is paused. Existing reserved amounts are unaffected.

> **Resume**
>
> Re-activates a paused stream. The freelancer can start new work sessions immediately.

> **Cancel**
>
> Ends the stream permanently and returns all **unreserved** escrow funds to your wallet.

> [!WARNING]
>
> Cancelling a stream returns unreserved funds to you, but pending and approved withdrawals must be resolved first. Do not cancel a stream while sessions are in a `Reserved` or `Disputed` state.

***

## Dashboard overview

> **[Dashboard](https://aven-chi.vercel.app/dashboard)**
>
> View all payment streams you have sent or received. Track funding, session activity, and attestations across all your engagements.

> **[Stream page](https://aven-chi.vercel.app/stream/create)**
>
> The `/stream/[id]` page is your primary hub for a live engagement: monitor sessions, review reports, and approve or dispute payments.

> **[Profile & attestations](https://aven-chi.vercel.app/profile)**
>
> Every approved session produces a portable on-chain attestation visible at `/profile/[address]`. You can verify any attestation independently at `/verify`.

> **[Create a stream](https://aven-chi.vercel.app/stream/create)**
>
> Start a new engagement with the guided four-step stream creation flow at `/stream/create`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.