Skip to content

JohnDr1971/speechAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ™οΈ Voice-to-Contract (V2C) β€” for Speech AI

Voice-to-Contract (V2C) is a frictionless interface layer for the Ethereum ecosystem that allows users to execute smart contract operations using natural spoken language. Integrated with the Speech AI protocol, this module enables secure, intent-driven interactions with DeFi protocols β€” completely hands-free.

✨ Features

  • 🎧 Voice-driven Web3 execution
  • 🧠 Multi-intent natural language parsing (swap, stake, transfer)
  • πŸ” Dynamic ABI-to-payload synthesis
  • πŸ” EIP-1559-compatible wallet signing
  • βœ… Modular EVM support
  • ⚠️ Built-in rule checks for slippage, value limits, and contract safelisting

πŸ—‚ Project Structure

src/ β”œβ”€β”€ main.ts # V2C engine entry point β”œβ”€β”€ nlp/ β”‚ └── intentParser.ts # Converts voice text into structured commands β”œβ”€β”€ tx/ β”‚ └── transactionBuilder.ts # Maps command β†’ ABI payload β”œβ”€β”€ signing/ β”‚ └── consentAndSign.ts # Wallet interaction and user consent

πŸ›  Supported Intents (Examples)

Intent Type Voice Example Result
Swap Swap 100 USDC to ETH with 1% max slippage Calls swapExactTokensForTokens
Stake Stake 2 ETH Calls stake(uint256)
Transfer Transfer 50 DAI to 0xabc... Calls transfer(address,uint256)

πŸš€ Usage

import { handleV2C } from './src/main';
import { ethers } from 'ethers';

const provider = new ethers.BrowserProvider(window.ethereum);
await provider.send("eth_requestAccounts", []);

handleV2C("stake 2 eth", provider, "0xYourWalletAddress");

πŸ”’ Security Notes

  • Transaction replay resistance via wallet nonce
  • Max limits & slippage enforcement included
  • Expandable with EIP-712 signing and proof-of-intent logs

πŸ”§ Dependencies

  • ethers.js (v6+)
  • Browser with voice-to-text input OR backend with Whisper/STT integration

🧩 Future Extensions

  • GPT-driven dynamic intent resolution
  • Whisper real-time microphone integration
  • Multichain support (via wagmi/rainbowkit)
  • Telegram bot interface

πŸ“„ License

MIT Β© Speech AI Labs

About

Voice to Contract

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published