A blockchain-based product authenticity verification system built on the Stellar network. Sellers register products on-chain and buyers verify genuineness using a unique Product ID — no middlemen, no central database.
| Layer | Technology |
|---|---|
| Smart Contract | Rust · Soroban SDK 21.x |
| Blockchain | Stellar Testnet |
| Frontend | React · Vite |
| Styling | Plain CSS |
| Wallet | Freighter Browser Extension |
verifyX/
├── contract/
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs
└── frontend/
├── index.html
├── vite.config.js
├── package.json
├── .env.example
└── src/
├── App.jsx
├── components/
│ ├── WalletConnect.jsx
│ ├── AddProduct.jsx
│ └── VerifyProduct.jsx
├── styles/
│ └── App.css
└── utils/
├── contract.js
└── freighter.js
| Value | |
|---|---|
| Network | Stellar Testnet |
| Contract ID | CAZLH6BM7ZCQKJFQK65LMZ2JVKBNWPA322QK4UNNG4OGXBZVXCHYOHCW |
| Explorer | View on Stellar Lab |
This is the second deployment — the contract was intentionally redeployed after the initial deployment to demonstrate the full deploy lifecycle.
Previous contract ID (revoked):
CBZFP5LCW7SCY5XOD5KMITXEMAJSUC3KNN3THM7OUEP2D6JIJSFRGLXI
- Rust (stable)
- Stellar CLI v25+
- Node.js v18+
- Freighter Wallet browser extension
Install Stellar CLI:
cargo install --locked stellar-cli --features optAdd the WebAssembly build target:
rustup target add wasm32v1-nonecd contract
stellar contract buildOutput: contract/target/wasm32v1-none/release/verifyx.wasm
cargo test# Create and fund a testnet identity
stellar keys generate alice --network testnet
stellar keys fund alice --network testnet
# Deploy
stellar contract deploy \
--wasm target/wasm32v1-none/release/verifyx.wasm \
--source alice \
--network testnetCopy the Contract ID from the output — you will need it for the frontend.
| Function | Parameters | Returns | Description |
|---|---|---|---|
add_product |
manufacturer: Address, name: String, brand: String |
u64 |
Register a product, returns its ID |
get_product |
id: u64 |
Product |
Returns product details or panics if not found |
verify_product |
id: u64 |
bool |
Returns true if the product exists |
get_product_count |
— | u64 |
Total number of registered products |
cd frontend
cp .env.example .envEdit .env:
VITE_CONTRACT_ID=YOUR_CONTRACT_ID_HERE
VITE_RPC_URL=https://soroban-testnet.stellar.orgnpm install
npm run devnpm run build
# Output: frontend/dist/- Install Freighter from freighter.app
- Create or import a wallet
- Switch network to Testnet inside the extension
- Fund your testnet address at Stellar Laboratory
Seller Blockchain Buyer
| | |
|-- Connect wallet ------------>| |
|-- Register product (name, | |
| brand) ------------------->| |
|<-- Product ID returned -------| |
| | |
| (Product ID shared |<-- Enter Product ID --------|
| with buyer) |--- Lookup on-chain -------->|
| |<-- Genuine / Not Found -----|
| Issue | Solution |
|---|---|
wasm32v1-none target missing |
Run rustup target add wasm32v1-none |
| Freighter not detected | Install the extension and refresh the page |
| Transaction fails | Ensure your Freighter account is funded on Testnet |
| Contract ID not found | Verify VITE_CONTRACT_ID in frontend/.env |
| Freighter on wrong network | Switch to Testnet inside the Freighter extension |
MIT