Skip to content

iamvon/pda-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solana PDA Wallet

A Solana PDA wallet with a Pinocchio program and a Rust CLI/TUI.

PDA Wallet Demo

Why This Exists

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, and TTL
  • relayer submits later if still valid
  • program verifies the owner ed25519 signature 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.

Disclaimer

This project is unaudited and experimental.

Use at your own risk.

Core Technical

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

Current Flow

  1. PDA Wallet
  2. Deposit
  3. Create Transfer
  4. Submit Signed Transfer

Create Transfer does not broadcast anything yet.

Submit Signed Transfer sends the saved signed transfer to the network.

Deployments

Network Program
Devnet pdazyUuHJiHe4CxVki3y2aNH7h1GEE56visqQJVhj6V
Mainnet Beta pdazyUuHJiHe4CxVki3y2aNH7h1GEE56visqQJVhj6V

Build

cargo build -p pda-wallet-cli
cargo build-sbf --manifest-path program/Cargo.toml

Run

Local:

NO_DNA=1 surfpool start --ci
./target/debug/pda-wallet-cli --rpc-url http://127.0.0.1:8899

Devnet:

./target/debug/pda-wallet-cli --rpc-url https://api.devnet.solana.com

Mainnet:

./target/debug/pda-wallet-cli --rpc-url https://api.mainnet-beta.solana.com

Logs

Log 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

License

MIT

About

A Solana PDA wallet using Pinocchio and a Rust CLI/TUI for delayed token transfers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages