Programmable Smart Wallet

What is a PROGRAMMABLE smart wallet

What is a Smart Wallet?

A Smart Wallet is a smart contract-based wallet adhering to the ERC-4337 standard.

Ethereum supports two main types of accounts for managing assets in blockchain: Externally Owned Accounts (EOAs) and Contract Accounts. A smart account is a wallet controlled by a contract account rather than an EOA. Unlike traditional wallets, smart accounts do not require private keys or seed phrases. They depend on code to secure and recover wallet information.

A smart account is accessed using a 'key' - a personal account. This key can range from a MetaMask wallet to an In-App Wallet and serves as a method to 'sign in' to the wallet.

To make account PROGRAMMABLE Ditto enables the installation of Ditto Automate Module that allows the storage of the calldata and its deferred execution in a flexible manner.

Account Types

Ditto offers the integration for any erc7579 compatible account, regardless of their origin:

  1. others

Users of 7579 accounts can install the Ditto Automation Module on their smart accounts like this

 function installModuleDitto() public {
        PackedUserOperation[] memory ops = new PackedUserOperation[](1);
        ops[0] = _prepareUserOp(
            VALIDATION_TYPE_ROOT,
            abi.encodeWithSelector(
                kernelAccount.installModule.selector, // given example on ZeroDev Kernel
                2,
                address(moduleAutomate7579),
                abi.encodePacked(address(0), abi.encode(abi.encodePacked("executorData"), abi.encodePacked("")))
            ),
            true
        );
        entrypoint.handleOps(ops, payable(address(0xdeadbeef)));
    }

Or like this as expanded in ditto JS SDK:

async function installModuleDitto() {
  const client = await DittoSDKInstance.getClient();

  const addressModule = DittoSDKInstance.Automate7579.getAddress();
  
  const userOpHash = await client.sendUserOperation({
      callData: await client.account.encodeCalls([{
        to: addressSmartAccount,
        value: BigInt(0),
        data: getInstallModuleCallData(addressModule),
      }]),
  })

Last updated