dGEN SubAccount SDK
Android SDK for managing smart contract sub-accounts on ethOS devices. Uses local P-256 cryptography (Android KeyStore) combined with the ethOS system wallet service for recovery, supporting ERC-4337 Account Abstraction, ERC-6492 signatures, and EIP-712 typed data signing.
Features
Local P-256 signing via Android KeyStore (no private keys leave the device)
Smart wallet address computation using CREATE2 (CoinbaseSmartWallet factory)
ERC-4337 UserOperations — build, sign, and submit through any bundler
Message signing —
personal_sign(ERC-191) andeth_signTypedData(EIP-712)ERC-6492 signature wrapping for undeployed wallets
Multi-chain support — Ethereum, Base, Optimism, Polygon, Arbitrum, and more
Batch transactions via
executeBatch
Requirements
Android minSdk 28 (Android 9+)
ethOS device — the SDK requires the ethOS system wallet service. Throws
NoSysWalletExceptionon non-ethOS devices.RPC endpoint (e.g. Alchemy, Infura)
Installation
JitPack
Add the JitPack repository to your root settings.gradle.kts:
Add the dependency to your module build.gradle.kts:
Replace
0.1.0with the latest release tag or usemain-SNAPSHOTfor the latest commit.
Packaging conflicts
If you encounter META-INF conflicts from web3j/netty transitive dependencies, add this to your app module's build.gradle.kts:
If using Java 17 records from web3j (AGP 8.x app modules), set:
Quick Start
Initialize the SDK
Get wallet address
Sign a message
Send a transaction
Batch transactions
Switch chains
API Reference
Constructor
context
Android Context
web3jInstance
Web3j RPC client (pass an authenticated RPC)
bundlerRPCUrl
ERC-4337 bundler endpoint (required)
factoryAddress
CoinbaseSmartWallet factory address
entryPointAddress
ERC-4337 EntryPoint v0.6 address
keyAlias
Android KeyStore alias for the P-256 signing key
Core Methods
suspend getAddress()
String
Smart wallet counterfactual address
suspend sendTransaction(to, value, data, callGas, chainId?, rpcEndpoint?, gasProvider?)
String
Send a single transaction via UserOperation
suspend sendTransaction(txParamsList, callGas, chainId?, ...)
String
Batch multiple transactions
suspend sendTransaction(userOp, chainId?, ...)
String
Submit a pre-built UserOperation
suspend signMessage(message, chainId, type?)
String
Sign message (personal_sign or eth_signTypedData)
fun signTypedData(typedDataJson, chainId)
String
Sign EIP-712 typed data directly
suspend changeChain(chainId, rpcEndpoint, bundlerRPCUrl)
String
Switch RPC and bundler to a different chain
suspend getNonce(senderAddress, rpcEndpoint?)
BigInteger
Get EntryPoint nonce
fun isDeployed(address)
Boolean
Check if wallet contract is deployed
suspend getPair()
Pair<BigInteger, BigInteger>?
Get P-256 public key coordinates (X, Y)
fun isEthOS()
Boolean
Always true (SDK requires ethOS)
Data Classes
Supported Chains
The SDK includes built-in RPC mappings via WalletSDK.getRPCforChainId():
Ethereum
1
Optimism
10
BNB Chain
56
Polygon
137
Arbitrum
42161
Base
8453
Base Sepolia
84532
Zora
7777777
Avalanche
43114
Custom chains are supported by passing your own web3jInstance and bundlerRPCUrl.
Demo App
The app/ module contains a Compose-based demo app that exercises the SDK. To run it:
Add your API keys to
local.properties:
Build and install:
The demo app provides:
Chain selector dropdown
SDK initialization with error handling
Wallet address and public key display
Message signing (personal_sign)
Transaction sending form
Result log
Architecture
Local P-256 key (Android KeyStore) — primary wallet owner, signs all operations
ethOS system service — provides the device recovery address (second owner)
CoinbaseSmartWallet factory — CREATE2 address computation and wallet deployment
ERC-4337 bundler — gas estimation and UserOperation submission
Github Repo:
Last updated