Inspiration
In today's digital economy, about $15 billion moves through credit card transactions every day. Traditional payment systems rely on centralized verification methods that are opaque, vulnerable to manipulation, and lack accountability. We asked ourselves: What if we could make fraud prevention transparent, verifiable, and immutable?
The inspiration for TrustJS came from three key observations:
- Trust Gap: Customers don't know if merchants are actually verifying their high-value transactions properly
- Fraud Explosion: E-commerce fraud is expected to grow by about 23.5% year-over-year, with traditional MFA systems easily bypassed
- Blockchain: Blockchain technology offers immutable audit trails, but hasn't been effectively applied to payment security
We envisioned a world where every security verification is publicly verifiable on the blockchain, creating unprecedented transparency in fraud prevention. The name "TrustJS" embodies our core belief: Trust is the only way forward in securing digital payments.
What it does
TrustJS is a blockchain-powered Multi-Factor Authentication (MFA) system that revolutionizes payment security through transparency and immutability. Here's what makes it unique:
Core Features
Smart Threshold MFA: Automatically triggers additional verification for transactions over a certain threshold, intelligently balancing security and user experience while also making sure it doesn't take too much computation time due to the nature of blockchain.
Blockchain Audit Trail: Every MFA verification is logged on the Polygon blockchain with:
- Immutable timestamp
- Cryptographic approval hash
- Merchant address
- Zero personally identifiable information (PII)
Real-Time Fraud Detection: Pattern recognition engine that identifies:
- Multiple failed MFA attempts
- Rapid transaction sequences
- High-value fraud attempts
- Suspicious behavioral patterns
Developer-First SDK: Production-ready NPM package (
trust-mfa-sdk) with:- React components & hooks for instant integration
- Vanilla JavaScript support
- TypeScript definitions
- Comprehensive documentation
Analytics Dashboard: Merchants can make dashboards with real-time insights of:
- Transaction trends and revenue tracking
- MFA success rate monitoring
- Fraud attempt visualization
- Blockchain transaction explorer
Use Cases
- E-commerce Platforms: Protect high-value purchases with verifiable MFA
- Subscription Services: Secure recurring payments over threshold amounts
- Marketplaces: Build trust through transparent fraud prevention
- Payment Gateways: Offer blockchain-verified security as a differentiator
How It Works
- Customer initiates a payment over the threshold amount
- TrustJS triggers OTP-based MFA verification
- Upon successful verification, an approval hash is generated
- The approval hash is logged to the Polygon blockchain
- Merchants and auditors can verify the transaction on-chain
- Payment proceeds with blockchain-backed proof of verification
How we built it
For the demo website of the SDK, we use React with Tailwind CSS for the frontend and Node.js + Express, along with Stripe API to process payments and Eather.js for blockchain interaction!
We used Solidity to make the smart contracts, Polygon Amoy Testnet for cost-effective transactions, Hardhat for contract development, and PolygonScan for public transaction verification!
SDK Development:
- Rollup for optimized bundling (CommonJS, ES Modules, UMD)
- TypeScript for comprehensive type definitions
- Jest for unit testing
- React Context API for state management
- Custom React hooks for developer ergonomics
Challenges we ran into
1. Blockchain Transaction Latency
Problem: Polygon transactions take 2-5 seconds to confirm, creating a poor UX if users had to wait for blockchain confirmation before completing their purchase.
Solution: Implemented asynchronous blockchain logging where the payment proceeds immediately after MFA verification, while blockchain logging happens in the background. Added a caching layer to avoid redundant blockchain queries.
Learning: Blockchain integration requires thoughtful async design patterns to maintain responsive UX.
2. Scaling of the Blockchain
Problem: As the blockchain keeps getting larger and larger, it will require increasingly more computing power, which may be feasible for a tech giant but is not feasible for a small business.
Solution: Used Layer 2 blockchain Polygon instead of Ethereum, which will make future scaling a bit easier. Also, not all transactions will be logged if the merchant/vendor wants, which will reduce the growth rate of the blockchain.
Learning: Learned about different types of blockchain and how to write smart contracts!
Accomplishments that we're proud of
Production-Grade SDK
We built a truly production-ready SDK that rivals commercial offerings:
- 98% test coverage across all modules
- < 50KB bundle size with full functionality
- Zero breaking changes across 4 major iterations
- Comprehensive docs with live code examples
- TypeScript first-class support for IntelliSense
Developer Experience
The SDK prioritizes developer happiness:
// Just 3 lines to add MFA!
<TrustJSProvider publishableKey="pk_..." merchantId="merchant_123">
<TrustButton amount="999.99" orderId="order_123">
Pay $999.99
</TrustButton>
</TrustJSProvider>
Deployed a Zero PII stored on-chain, only cryptographic hashes
What we learned
Blockchain: We learned how to use blockchain not just for storing stuff but for actual verification, and we also learned how to make smart contracts and used this technology in a meaningful way!
We learned how to make and document an SDK while also keeping Developer Experience in mind, making our SDK as easy to use as possible and really customizable at the same time!
What's next for TrustJS
- Set up automated CI/CD for package releases
- Create npm badges and shields for README
- Ethereum mainnet support
- Arbitrum and Optimism for lower fees
- Multi-chain verification dashboard
Built With
- etherium
- javascript
- npm
- solidity
- typescript

Log in or sign up for Devpost to join the conversation.