← Index
Source: docs/archive/nostra/designs/task-3-batching.md (auto-generated by scripts/generate-docs-html.mjs — edit the .md, not this file)

Task 3: Batching Transactions & Signatures Design

Objective

Reduce the number of user interactions (wallet popups) required for trading, specifically for:

  1. Batch Execution: Performing multiple actions (e.g., buying multiple outcomes) in a single transaction.
  2. Batch Creation: Placing multiple limit orders without signing each one individually.

Proposed Solution

1. Batch Execution (Transactions) using Multicall

Problem: If a user wants to buy YES shares in 3 different markets, they currently send 3 transactions. Solution: Implement Multicall in the CTFExchange contract.

Contract Changes (nostra-contracts):

Frontend Changes (web):

2. Batch Creation (Signatures) using Session Keys

Problem: Creating multiple limit orders requires signing an EIP-712 message for each order. Solution: Implement Session Keys (Delegates). The user approves a temporary key (Session Key) to sign orders on their behalf.

Contract Changes (nostra-contracts):

Frontend Changes (web):

Implementation Roadmap

Phase 1: Multicall (Immediate)

  1. Add Multicall inheritance to CTFExchange.
  2. Redeploy.
  3. Update Frontend to use multicall for batch trades.

Phase 2: Session Keys (Future Scope)

Note: To be implemented in a later iteration to further reduce signature fatigue.

  1. Implement Delegates logic in contracts.
  2. Update validateOrderSignature.
  3. Redeploy.
  4. Implement Session Key management in Frontend.

Considerations