Skip to content

Nulltx-xyz/nulltx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

140 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

NULLTX banner

build license version last commit stars contributors issues website twitter


Decentralized pre-sign transaction firewall for Solana. Staked validator nodes simulate every transaction before your key signs. Built with Rust, Anchor, and TypeScript.

Features

Component Description Status
On-chain program Registry, node management, consensus, threat DB stable
TypeScript SDK @nulltx/sdk - verify transactions in one line stable
CLI nulltx-cli - verify, check, manage nodes, live feed stable
Threat registry On-chain drainer/phishing/honeypot address database stable
Weighted consensus BFT-lite with stake + reputation voting stable
Slash mechanism Lying nodes lose stake, funding the reward pool stable

Architecture

                              NULLTX NETWORK
                                    
  Wallet/DEX          Validator Quorum           On-chain
  ---------          ----------------           --------
                                                
  tx built  -------> broadcast to N nodes       Registry
                     |                          NodeAccount
                     v                          ThreatEntry
                     simulate tx (forked RPC)   VerdictEntry
                     |                          ConsensusResult
                     v                          
                     each node votes:           
                     SAFE / SUSPICIOUS /        
                     MALICIOUS                  
                     |                          
                     v                          
                     2/3 supermajority          
                     = final verdict            
                     |                          
  verdict <--------- return in <50ms            
  |                                             
  v                                             
  sign or reject                                

The system operates on four layers:

  1. On-chain registry stores node registrations, staked collateral, threat entries, and finalized consensus results as Solana accounts with PDA derivation.

  2. Validator network consists of independently operated nodes that receive transaction payloads, run forked simulations, pattern-match against known threats, and submit signed verdicts.

  3. Consensus engine tallies weighted votes (stake amount * reputation score), applies a 66.67% supermajority threshold, and distributes rewards to honest nodes. Nodes that consistently vote against consensus get slashed.

  4. SDK/CLI layer provides a single-function integration point for wallets, DEXs, and bots to intercept transactions before signing.

Performance

Metric Value
Verdict latency (p50) 28ms
Verdict latency (p99) 48ms
Quorum size 5 nodes (configurable)
Consensus threshold 66.67% supermajority
Max throughput 2,400 tx/min per node
Slash penalty 10% of staked amount
Minimum stake 1 SOL

Threat Detection

Category Detection Method Risk Score
Drainer Unlimited token approval, authority transfer 850-1000
Phishing Fake program impersonation (Jupiter, Raydium) 800-950
Honeypot Buy-only token, locked LP drain 700-900
Sandwich MEV sandwich + drain combo 750-950
Malicious program Hidden CPI, undocumented instructions 600-900
Fake token Cloned metadata, rug mechanics 650-850

Build

git clone https://github.com/nulltx-xyz/nulltx.git
cd nulltx

Build the on-chain program (requires Solana CLI + Anchor in WSL):

anchor build

Build the CLI:

cargo build -p nulltx-cli --release

Build the SDK:

cd sdk
npm install
npm run build

Quick Start

Verify a transaction (TypeScript)

import { NulltxClient } from '@nulltx/sdk'

const client = new NulltxClient({
  rpcUrl: 'https://api.mainnet-beta.solana.com',
  timeout: 5000,
})

const verdict = await client.verify(transaction, {
  wallet: walletPublicKey,
  network: 'mainnet-beta',
})
// { risk: 'block', score: 920, verdict: { type: 'malicious', reason: 'unlimited BONK approval to known drainer 9xQe...', threats: [...] }, latencyMs: 34 }

if (verdict.risk === 'block') {
  throw new DrainerBlockedError(verdict)
}

wallet.sign(transaction) // safe

Check an address (TypeScript)

const threat = await client.checkAddress('9xQe...drainerAddress')
// { address: '9xQe...', category: 'drainer', severity: 9, confidence: 94, matchedPattern: 'unlimited_approve' }

Verify via CLI

nulltx verify <TX_BASE64> --network mainnet-beta
# Risk: BLOCK (score: 920)
# Threats: 1 drainer detected
# Saved: 18.4 SOL

nulltx check 9xQe...drainerAddress
# Category: drainer
# Severity: 9/10
# Confirmations: 47

Register a validator node

nulltx node register --stake 10 --endpoint https://mynode.nulltx.xyz --keypair ~/.config/solana/id.json

Run via Rust

use nulltx_cli::config::NulltxCliConfig;

let config = NulltxCliConfig::load_or_default()?;
println!("RPC: {}", config.rpc_url);
println!("Quorum endpoints: {:?}", config.quorum_endpoints);

Project Structure

nulltx/
├── programs/nulltx/              On-chain Anchor program
│   └── src/
│       ├── lib.rs                Program entry, instruction dispatch
│       ├── constants.rs          Seeds, thresholds, limits
│       ├── errors.rs             22 custom error codes
│       ├── instructions/
│       │   ├── initialize.rs         Registry initialization
│       │   ├── register_node.rs      Node registration + stake transfer
│       │   ├── deregister_node.rs    Two-phase node removal with cooldown
│       │   ├── submit_verdict.rs     Per-node verdict submission
│       │   ├── finalize_consensus.rs Vote tallying + reputation updates
│       │   ├── slash_node.rs         Stake slashing + reward pool funding
│       │   ├── update_threat.rs      Threat registry entry management
│       │   ├── query_threat.rs       Threat lookup with risk scoring
│       │   ├── update_config.rs      Authority-only config updates
│       │   └── withdraw_rewards.rs   Node reward withdrawal
│       └── state/
│           ├── registry.rs       Global registry + config
│           ├── node.rs           Node account + status enum
│           ├── verdict.rs        Verdict entries + consensus results
│           └── threat.rs         Threat entries + category enum
├── sdk/                          TypeScript SDK (@nulltx/sdk)
│   └── src/
│       ├── index.ts              Barrel exports
│       ├── types.ts              All interfaces and types
│       ├── client.ts             NulltxClient class
│       ├── verify.ts             Verification pipeline
│       ├── simulate.ts           Transaction simulation engine
│       ├── consensus.ts          Weighted BFT consensus
│       └── utils/
│           ├── rpc.ts            RPC helpers, retry logic
│           └── serialize.ts      Wire format serialization
├── cli/                          Rust CLI (nulltx-cli)
│   └── src/
│       ├── main.rs               CLI entry, clap derive
│       ├── config.rs             Config management
│       └── commands/
│           ├── verify.rs         Transaction verification
│           ├── check.rs          Address threat check
│           ├── node.rs           Node register/status/withdraw
│           ├── network.rs        Network statistics
│           └── feed.rs           Live verdict feed
├── tests/
│   ├── integration/              Devnet integration tests
│   └── fixtures/                 Test transaction data
├── docs/
│   ├── architecture.md           Technical architecture
│   ├── sdk-reference.md          SDK API reference
│   ├── node-operator-guide.md    Node operator guide
│   └── threat-patterns.md        Threat detection patterns
├── examples/                     Usage examples (TypeScript)
├── scripts/                      Setup and deployment scripts
├── idl/nulltx.json               Anchor IDL
├── Anchor.toml                   Anchor workspace config
├── Cargo.toml                    Rust workspace manifest
└── Makefile                      Build targets

Contributing

See CONTRIBUTING.md for development setup and PR guidelines.

License

MIT. See LICENSE.

Links

About

Decentralized pre-sign transaction firewall for Solana. Staked nodes simulate every tx before your key signs.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors