gitchain-sol
v0.4.2
Published
Software provenance & lineage protocol on Solana — fingerprint, register, and verify code on-chain
Maintainers
Readme
gitchain
Software provenance & lineage protocol on Solana. Fingerprint your code, register it on-chain with stake-backed provenance, detect AI rewrites, and resolve disputes deterministically.
Install
npm install -g gitchain-solPrerequisites
- Node.js 18+
- Solana CLI (for wallet management):
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" - Create a wallet (one-time):
solana-keygen new solana config set --url devnet - Fund your wallet (devnet):
If airdrop fails (rate-limited), use https://faucet.solana.comsolana airdrop 2 --url devnet
Quick Start
cd your-project
gitchain init # initialize tracking
gitchain publish origin main # fingerprint + register + push
gitchain status # check on-chain stateCommands
Publish (register + push)
gitchain publish origin main --stake 0.2- Fingerprints all source files (SHA-256 Merkle tree + AST structural hashes)
- Scans on-chain registry for lineage/overlap
- Registers on Solana with SOL stake (default: 0.1 SOL)
- Uploads file hashes + structural hashes on-chain
git pushto your remote
Verify (check any code against on-chain records)
gitchain verify ./suspect-code
gitchain verify ./suspect-code --json # machine-readable output
gitchain verify ./suspect-code --verbose # show all function matchesCompares a local directory against all registered projects. Reports:
- Content overlap %
- Structural overlap % (AST-level, catches AI rewrites)
- Signature/skeleton overlap
- AI rewrite score (0-100)
- Composite verdict with confidence
Clone (with provenance check)
gitchain clone https://github.com/user/repo.gitStatus
gitchain statusLineage
gitchain lineage # show ancestry tree + overlap scan
gitchain lineage --jsonChallenge (V2 Provenance Court)
gitchain challenge <defendant-pda>File a dispute against a project you believe copied your code. Compares file hashes on-chain and submits overlap proof.
Resolve
gitchain resolve <dispute-pda>Resolve an open dispute. Deterministic: >=40% overlap = challenger wins, <40% = defendant wins. Stake transfers to the winner.
Withdraw
gitchain withdrawReclaim your stake after verification or 30-day period.
Disputes
gitchain disputes # disputes for current project
gitchain disputes --all # all disputes on-chainHow It Works
GitChain creates a multi-layer fingerprint of your source code:
- File hashes — SHA-256 of each source file (CRLF/LF normalized)
- Merkle root — Merkle tree of all file hashes
- Structural hashes — AST-level function fingerprints (catches AI rewrites where every line is different but the structure is the same)
- Function signatures — name + param count hashing for cross-file rename detection
These are stored in Solana PDAs tied to your wallet and project name. The V2 Provenance Court adds:
- Stake-backed registration — put SOL behind your claim of originality
- On-chain challenges — anyone can dispute with overlap proof
- Deterministic resolution — hash comparison on-chain, no subjective judging
- Stake slashing — plagiarists lose their stake to the challenger
Program
- Network: Solana Devnet
- Program ID:
5bHSYFLoEtoxQnqi6vuDvjFGbcuwnLJbi6wJbHmHW8R4 - Explorer: https://explorer.solana.com/address/5bHSYFLoEtoxQnqi6vuDvjFGbcuwnLJbi6wJbHmHW8R4?cluster=devnet
License
MIT
