Ditto SDK: Simplifying Web3 Workflow Automation

Ditto SDK: Simplifying Web3 Workflow Automation

Introducing Ditto JS SDK

Ditto Network is a modular infrastructure for event-driven workflows and actively validating keeper network (AVS) on Eigenlayer. Our mission is to simplify and secure interactions with digital assets in the Web3 ecosystem.

Today, we introduce the Ditto SDK to simplify Web3 application development. With our SDK, you can streamline user interaction with EVM networks by batching transactions and also perform operations like delayed transactions, workflow automation, and much more.

What is Ditto JS SDK?

Ditto SDK has gathered essential methods in one place to make it easier for developers. It consists of two main modules that facilitate interaction with the protocol:

  • SmartWalletFactory: Tools for creating and managing smart accounts, such as the Ditto Smart Wallet Factory (SmartWalletFactory class).
  • WorkflowsFactory: Modules for creating, managing, and automating complex workflows

Key Features and Use Cases

1. Ditto Smart Wallet Factory

The Ditto Smart Wallet Factory is a modular smart contract wallet designed to securely hold and manage assets, execute deferred tasks, and interact with DeFi protocols. This feature-rich wallet simplifies user interactions by allowing transactions to be signed with either an EOA (Externally Owned Account) or session keys (social login feature). This reduces barriers to entry, making it ideal for:

  • Native Account Abstraction Wallets: Provides a seamless user experience for blockchain-based applications.
  • DeFi Applications: Enables users to interact with DeFi protocols effortlessly.
  • GameFi Applications: Integrates blockchain functionalities into gaming platforms with ease.

2. Workflow Modules: Actions and Triggers

Ditto SDK simplifies complex blockchain interactions through its modular approach. Actions are the building blocks of a workflow, and they can be customized to meet various needs. For instance:

  • Asset Swapping: Using the swap module, users can swap multiple assets at once.
  • Price Triggers: Automate trades based on specific price points, such as buying ETH when it hits $3500.

As our AVS on Eigenlayer evolves, these actions will be executed through a decentralized and reliable execution network, enhancing security and efficiency.

Installation and Setup

Getting started with the Ditto SDK is straightforward. Follow these steps to integrate it into your project:

  1. Installation:
  • Ensure you have Node.js installed.
  • Install the Ditto SDK using npm or yarn:
npm install @ditto-network/core @ditto-network/ethers ethers

2. Setup

  • Import the SDK into your project:
import { Provider, SmartWalletFactory, BrowserStorage } from '@ditto-network/core'; 
import { EthersSigner, EthersContractFactory } from '@ditto-network/ethers';

3. Configuration:

  • Initialize the SDK:
const provider = new Provider({ 
  signer: new EthersSigner(signer), 
  storage: new BrowserStorage(), 
  contractFactory: new EthersContractFactory(signer), 
}); 
const swFactory = new SmartWalletFactory(provider); 
 
const sw = await swFactory.getDefaultOrCreateVault(); 
const vaultAddress = sw.getAddress(); 
 
console.log('Vault address:', vaultAddress);

4. Usage Examples:

  • Creating a Smart Wallet:
const chainId = 1; // Ethereum mainnet 
const nextVaultId = await swFactory.getNextVaultId(chainId); 
const vault = await swFactory.createVault(chainId, nextVaultId); 
const vaultAddress = vault.getAddress(); 
console.log(`New Vault Address: ${vaultAddress}`);
  • Executing a Workflow:
const workflowFactory = new WorkflowsFactory(provider); 
 
const wf = await workflowFactory.create({ 
  name: 'MultiSender Action Example', 
  triggers: [], // instant workflow execution 
  actions: [new MultiSenderAction(/* ... */)], 
  chainId, 
}); 
 
const tx = await wf.buildAndDeploy(swAddress, account);

For detailed documentation and advanced configuration options, refer to the Ditto SDK documentation.

Use cases

  • DeFi Platforms: Users can interact with DeFi protocols, manage assets, and perform batch transactions seamlessly.
  • GameFi Integrations: Enables blockchain functionalities within gaming environments, enhancing user experience.
  • Automated Workflows: Facilitates complex workflows like asset swapping and price-triggered trades.

How Ditto SDK helps cut dev time and costs by 10x

The Ditto SDK massively cuts down on the time and resources involved in making Web3 apps. Usually, making these dApps involves picking all sorts of stuff like smart wallets, paymasters, and bundlers, writing and checking smart contracts, and that can take like few months just to set up basic infrastructure! But with Ditto SDK, you can do it all in one go.

Using Ditto SDK makes it so you don’t need a bunch of deep knowledge in different areas or a big team to handle the integration and testing. It makes the process simpler and faster, which speeds up development and lowers costs. It’s much easier and cheaper to make blockchain apps that use pre-made integrations to bring new value to the ecosystem.

What could be built using SDK

  • Trading Bots: Create trading bots that work on any EVM compatible network. Ditto’s automation capabilities make trading strategies more efficient and reliable.
  • On-Chain Workflow Automation Platform: Develop a platform to automate various on-chain workflows. Users can share their automation setups via Social Neworks, making it easy to spread and adopt optimized workflows.
  • Social Trading Platforms: Build platforms where users share their portfolios, enabling social trading and collective investment strategies.
  • GameFi Integrations: Enhance gaming platforms by integrating automated actions, providing a seamless and secure gaming experience.
  • Your Creativity: These are just a few examples that come to mind. There are no limits to what you can achieve with our SDK’s capabilities.

What’s next

Ditto SDK is continuously evolving, with new modules and features being developed to further simplify and enhance blockchain application development. Some upcoming features include:

  • ERC-7579 Standard: Future updates will include support for ERC-7579 accounts, allowing the same automation capabilities as Ditto Vaults.
  • History and Indexing: Improved transaction history and indexing functionalities via API, providing ready-to-use methods for managing available workflow automations.

Become an early adopter

Explore the possibilities with Ditto SDK and elevate your blockchain applications to the next level. For more information, visit our Documentation or Contact Us.

About Ditto Network

Ditto Network is a trustless actively validated keeper network (AVS) that runs event-driven workflows with economic guarantees of execution, leveraging shared security. In addition, Ditto offers various intent-centric automation modules and SDKs for founders and developers, introducing the future of embedded finance solutions in Web3.

The team is comprised of experienced web3 developers and professionals with backgrounds and previous exits in web3 from McKinsey, Uniswap, Nil Foundation, TrustWallet, NEAR, 3Commas, and PE/VC.

Website | X | Discord | Book a Call to Integrate Ditto to Your Project