Skip to content

Conversation

@theref
Copy link
Contributor

@theref theref commented Aug 19, 2025

Summary

  • Add comprehensive TACo Account Abstraction signing demo for adopters
  • Single-file implementation showing TACo threshold signatures with ERC-4337
  • Complete documentation with example output and setup instructions

Demo Features

  • Real TACo testnet integration (2-of-3 threshold)
  • MetaMask Delegation Toolkit smart account creation
  • Balance tracking and fund management
  • Pimlico bundler integration for UserOperation execution
  • Clean developer experience with minimal boilerplate

Test Plan

  • Demo builds successfully
  • All tests pass
  • Linting passes
  • Documentation is clear and complete

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive TACo Account Abstraction signing demo that demonstrates how to use TACo's distributed threshold signatures with ERC-4337 Account Abstraction. The demo creates a smart account using MetaMask Delegation Toolkit with TACo signers and executes real transactions on Sepolia testnet.

Key Changes:

  • Added complete working demo with TACo testnet integration (2-of-3 threshold)
  • Implemented MetaMask Delegation Toolkit smart account creation with balance tracking
  • Added Pimlico bundler integration for UserOperation execution with comprehensive documentation

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
demos/taco-aa-signing/src/index.ts Main demo implementation showing TACo threshold signatures with ERC-4337
demos/taco-aa-signing/package.json Project dependencies including TACo, viem, and MetaMask delegation toolkit
demos/taco-aa-signing/README.md Complete documentation with setup instructions and example output
demos/taco-aa-signing/tsconfig.json TypeScript configuration extending the root config
demos/taco-aa-signing/.env.example Environment configuration template for RPC, private key, and bundler
demos/README.md Updated main demos index to include the new TACo AA signing demo

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Add comprehensive demo showing how to integrate TACo's distributed
threshold signatures with Account Abstraction wallets using MetaMask
Delegation Toolkit.

Features:
- Single-file implementation
- Real TACo testnet integration with 2-of-3 threshold
- Balance tracking and fund management
- ERC-4337 UserOperation signing with Pimlico bundler
- Clean documentation with example output
@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 63.04348% with 17 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (signing-epic@02762f8). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...shared/src/contracts/agents/signing-coordinator.ts 5.55% 17 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##             signing-epic     #693   +/-   ##
===============================================
  Coverage                ?   88.85%           
===============================================
  Files                   ?       92           
  Lines                   ?     7934           
  Branches                ?      279           
===============================================
  Hits                    ?     7050           
  Misses                  ?      881           
  Partials                ?        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…uality

- Replace ts-node with tsx for better performance and compatibility
- Add --dry-run flag support for CI syntax checking
- Relax TypeScript strict mode for third-party type incompatibilities
- Add explicit TypeScript type annotations for better type safety
- Apply Prettier formatting to improve code consistency
- Fix type casting for viem/account-abstraction compatibility
- Update dependencies in pnpm-lock.yaml
- Add createViemTacoAccount utility to wrap TACo signers as Viem accounts
- Replace localAccount parameter with TACo-wrapped account in smart account creation
- Update function signature to eliminate private key requirement for signatory
- Improve type safety by replacing explicit 'any' types where possible
- Add ESLint exemptions for necessary type casts due to library incompatibilities

Resolves nucypher#699: AA demo now works without local wallet, making it AI agent ready
Copy link
Contributor

@Muhammad-Altabba Muhammad-Altabba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see AA in this nice demo 🚀

I had some questions mostly about adding some helper functions to taco-web.

// This satisfies MetaMask's signatory requirement without using a local wallet
const tacoAccount = createViemTacoAccount(signers[0]);

const smartAccount = await toMetaMaskSmartAccount({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have the demo as a webpage, in order to check directly with MetaMask? Or is it that we like to run the demo in the command line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check what with metamask? I'm not sure what running in the browser would show here

return { smartAccount, threshold };
}

async function signUserOpWithTaco(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we generalize this, making it more type-safe, and have it as part of taco-web? I mean specifically for

  const tacoUserOp: UserOperation = {
    sender: userOp.sender,
    nonce: Number(userOp.nonce),
    factory: userOp.factory || '0x',
    factoryData: userOp.factoryData || '0x',
    callData: userOp.callData,
    callGasLimit: Number(userOp.callGasLimit),
    verificationGasLimit: Number(userOp.verificationGasLimit),
    preVerificationGas: Number(userOp.preVerificationGas),
    maxFeePerGas: Number(userOp.maxFeePerGas),
    maxPriorityFeePerGas: Number(userOp.maxPriorityFeePerGas),
    paymaster: userOp.paymaster || '0x',
    paymasterVerificationGasLimit: Number(
      userOp.paymasterVerificationGasLimit || 0,
    ),
    paymasterPostOpGasLimit: Number(userOp.paymasterPostOpGasLimit || 0),
    paymasterData: userOp.paymasterData || '0x',
    signature: '0x',
  };

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is to do with converting from a Viem UserOp. I'm opening to making the sdk more general, but I think we should wait until your Viem PR is in. This is just demo code for an adopter

const COHORT_ID = 1;
const AA_VERSION = 'mdt';

async function createTacoSmartAccount(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to generalize this function and put it or part of it inside taco-web?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is specific to Metamask (i don't know if other AA wallets will require the same). It's also viem specific, so if we do this, Viem becomes a dependency.

theref and others added 2 commits September 9, 2025 10:44
Co-authored-by: Derek Pierre <[email protected]>
Co-authored-by: Muhammad Altabba <[email protected]>
- Rename demo folder to be MetaMask Delegation Toolkit specific
- Update package name to taco-mdt-aa-signing-demo
- Update README title to include "MetaMask Delegation Toolkit"
- Add note explaining MDT-specific implementation requirements
- Update main demos README link reference

Addresses Derek's feedback in PR nucypher#693 about making the demo more
specific to MetaMask's Delegation Toolkit implementation.
theref added a commit to theref/taco-web that referenced this pull request Sep 10, 2025
…gner

- Add getCohortMultisigAddress() method to SigningCoordinatorAgent
  - Calls getSigningCoordinatorChild(chainId) to get child contract
  - Uses cohortMultisigs(cohortId) mapping to get actual multisig address
- Update taco-mdt-aa-signing demo to use cohort multisig address
- Replace signers[0] placeholder with proper deployed multisig contract
- Add console log showing cohort multisig address being used
- Update documentation to reflect multisig vs individual signer usage

Addresses Derek's feedback in PR nucypher#693 to use the deployed cohort
multisig contract (e.g., 0x857949079dB532301157Eb7Fb5AEC3398043A186)
instead of individual signer addresses for ERC-1271 compatibility.

Successfully tested - demo retrieves correct multisig and executes transactions.
…gner

- Add getCohortMultisigAddress() method to SigningCoordinatorAgent
  - Calls getSigningCoordinatorChild(chainId) to get child contract
  - Uses cohortMultisigs(cohortId) mapping to get actual multisig address
- Update taco-mdt-aa-signing demo to use cohort multisig address
- Replace signers[0] placeholder with proper deployed multisig contract
- Add console log showing cohort multisig address being used
- Update documentation to reflect multisig vs individual signer usage

Addresses Derek's feedback in PR nucypher#693 to use the deployed cohort
multisig contract (e.g., 0x857949079dB532301157Eb7Fb5AEC3398043A186)
instead of individual signer addresses for ERC-1271 compatibility.

Successfully tested - demo retrieves correct multisig and executes transactions.
Copy link
Contributor

@Muhammad-Altabba Muhammad-Altabba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Also it is good to have a follow-up task to check and add possible abstracted code to taco-web, if it was generic enough to be so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants