Skip to content

samarthgupta128/Sentinal-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentient Wallet

An intent-based interface for interacting with Abstracted Smart Accounts on Base Sepolia. This project demonstrates how natural language inputs can be translated into on-chain execution using Account Abstraction.

Overview

The goal of this project is to simplify blockchain interactions by removing the need for users to manually handle transaction construction, gas management, and hexadecimal signatures.

Instead of traditional UI flows, Sentient Wallet uses an agentic workflow:

  1. Input: User provides a natural language command (e.g., "Swap 1 ETH").
  2. Parsing: The system resolves the intent (Action, Asset, Amount).
  3. Execution: The system initializes a Modular Smart Account via Alchemy's Account Kit and constructs the necessary UserOperation.

Architecture

The codebase is modularized into three core components:

  • Agent (agent.js): Manages the Command Line Interface (CLI) and user session loop.
  • Parser (parser.js): Handles the logic for mapping text inputs to executable transaction parameters.
  • Wallet Engine (wallet.js): Integrates with the Alchemy SDK and Viem to manage keys, deploy smart accounts (ERC-4337), and sign transactions.

Note: For the demonstration build, these modules are aggregated into demo.js to ensure a single, stable runtime environment.

Tech Stack

  • Runtime: Node.js
  • Infrastructure: Alchemy Account Kit (AA-SDK)
  • Network: Base Sepolia (Layer 2 Testnet)
  • Ethereum Library: Viem

Setup and Installation

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm or yarn
  • An Alchemy API Key for Base Sepolia

Installation

  1. Clone the repository: git clone https://github.com/samarthgupta128/Sentinel-wallet.git cd Sentinel-wallet

  2. Install dependencies: npm install

  3. Environment Configuration: Create a file named .env in the root directory and add the following keys:

    ALCHEMY_API_KEY=your_alchemy_api_key_here PRIVATE_KEY=your_private_key_here

    (If PRIVATE_KEY is omitted, a new random key will be generated for the session).

Usage

To run the full demonstration:

node demo.js

Once the system initializes, you can enter commands such as:

swap 1 eth

The system will output the derived intent, the generated Smart Account address, and the transaction hash upon execution.

Future Improvements

  • LLM Integration: Replace the current deterministic parser with a Large Language Model to handle complex, multi-step intents.
  • Paymaster Integration: Implement gas sponsorship to allow for gasless transactions.
  • Voice Interface: Add speech-to-text capabilities for mobile interactions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •