Standalone Mini Apps

This guide provides a generic implementation pattern for Standalone Mini Apps. It focuses on the core technical building blocks required to make these flows reliable and production-safe.

If you are a vibecode developer, you can simply copy the entire page using the button above and paste in your coding environment

Standalone Mini Apps generally have the following flow:

  1. Create a short-lived intent (intentId, reference, amount, recipient, expiresAt).

  2. Encode intent reference into transfer data.

  3. Build a Gnosis App deep link URL.

  4. Render QR from that URL.

  5. Query transfer-data events for the recipient.

  6. Decode and match event data against your intent.

  7. Verify transfer amount from receipt logs.

  8. Run your business action.

Gnosis App Deep Link Format

For CRC transfer flows:

https://app.gnosis.io/transfer/{recipientAddress}/crc?amount={amountCrc}&data={urlEncodedTransferData}
  • recipientAddress: expected receiving address

  • amount: human-readable CRC amount string

  • data: URL-encoded transfer-data payload used for deterministic matching

Example:

Use the Circles SDK Transfer Data Encoder

Use SDK utils instead of custom encoding:

Encoded structure:

  1. version (1 byte)

  2. type (2 bytes)

  3. length (2 bytes)

  4. payload (N bytes)

This gives consistent decoding and catches malformed data (version/length mismatch).

Which Data Type to Use

  • 0x0001: UTF-8 text payload

  • 0x1001: UTF-8 message + metadata payload

Recommended:

  • Use 0x0001 when you only need a reference string.

  • Use 0x1001 when you want message + structured metadata.

0x0001 example:

0x1001 example:

Build QR URL with Encoded Data

Richer context example:

Detect Transactions with Transfer Data RPC Query

Use circles_events scoped to the expected recipient and filtered to transfer-data events.

Request:

Detection:

  1. Fetch events via circles_events.

  2. Filter to == recipientAddress.

  3. Decode each event data.

  4. Match decoded reference to expected intent reference.

  5. Verify amount and tx success via receipt logs.

Do not match on amount alone.

Decode and Extract Reference Reliably

Verify Amount from Receipt Logs

After reference match, load tx receipt and compute actual transferred amount.

For Circles flows, sum all relevant transfer amounts for matching from -> to across receipt logs, then compare:

Idempotent Post-Confirmation Actions

Minimal End-to-End Example

Using encodeCrcV2TransferData / decodeCrcV2TransferData plus circles_events (CrcV2_TransferData) makes QR detection deterministic and keeps transactions properly annotated in Gnosis App for better UX. Now that the payment/user action is successfully decoded, you can proceed with your app's own business logic, be it a payout for winning a game, processing refund for a store, etc.

Last updated

Was this helpful?