A Solana PDA wallet with a Pinocchio program and a Rust CLI/TUI.
This project explores an alternative approach to delayed transaction submission for token transfers on Solana:
1 owner wallet -> 1 deterministic PDA wallet- owner signs a transfer authorization off-chain
- authorization includes
amount,nonce, andTTL - relayer submits later if still valid
- program verifies the owner
ed25519signature on-chain
The goal is to experiment with a TTL-based PDA wallet flow that could replace durable nonces in the future, especially where durable nonces handling introduces extra security considerations and runtime complexity.
This project is unaudited and experimental.
Use at your own risk.
PDA derivation:
config_pda = Pubkey::find_program_address(
&[CONFIG_SEED, owner_pubkey.as_ref()],
&program_id,
)
pda_wallet = Pubkey::find_program_address(
&[VAULT_SEED, owner_pubkey.as_ref()],
&program_id,
)Current model:
1 owner wallet -> 1 config PDA -> 1 PDA wallet
On-chain validation:
owner signs off-chain -> relayer submits later -> program verifies ed25519 signature on-chain -> PDA wallet transfer executes if nonce and TTL are valid
PDA WalletDepositCreate TransferSubmit Signed Transfer
Create Transfer does not broadcast anything yet.
Submit Signed Transfer sends the saved signed transfer to the network.
| Network | Program |
|---|---|
| Devnet | pdazyUuHJiHe4CxVki3y2aNH7h1GEE56visqQJVhj6V |
| Mainnet Beta | pdazyUuHJiHe4CxVki3y2aNH7h1GEE56visqQJVhj6V |
cargo build -p pda-wallet-cli
cargo build-sbf --manifest-path program/Cargo.tomlLocal:
NO_DNA=1 surfpool start --ci
./target/debug/pda-wallet-cli --rpc-url http://127.0.0.1:8899Devnet:
./target/debug/pda-wallet-cli --rpc-url https://api.devnet.solana.comMainnet:
./target/debug/pda-wallet-cli --rpc-url https://api.mainnet-beta.solana.comLog file:
logs/pda_wallet_session.log
- file logs use UTC
- wallet logs display local time
- wallet logs shorten long addresses/signatures for readability
- log file keeps full values
MIT
