- Live DApp: https://privatestream-stellar.vercel.app
- API Endpoint: https://privatestream-api.onrender.com
- Demo Video: https://youtu.be/bD0Y5NGFulY
In today's digital economy, data is incredibly valuable (e.g., IoT sensor streams, high-frequency trading feeds, AI analytics). However, existing platforms for monetizing continuous data streams suffer from:
- High Middleman Fees: Centralized marketplaces take huge cuts.
- Lack of Privacy: Buyers' and sellers' financial agreements, budgets, and spending habits are exposed on public blockchains.
- Inefficient Micro-payments: Streaming data requires paying per-second or per-byte, which is expensive and slow on legacy payment rails.
- Trust Issues: Buyers must pre-pay without a guarantee of data quality, while sellers risk giving away data without guaranteed payment.
PrivateStream is a decentralized, pay-as-you-go data streaming marketplace built on Stellar's Soroban smart contracts.
- True Pay-As-You-Go: Buyers only pay for the exact seconds/bytes of data they consume using high-speed micropayments.
- Confidentiality: Utilizing Pedersen commitments and Zero-Knowledge proofs (Confidential Tokens), the exact payment amounts and budgets are completely hidden on the blockchain, preserving institutional privacy while maintaining auditor compliance.
- Decentralized Escrow: A Soroban smart contract holds the buyer's budget in escrow. When a session is closed, it guarantees the provider gets paid exactly what they earned, and the buyer gets refunded the remainder.
- Smart Contracts (Rust/Soroban): Handles dataset registration, provider verification, and the core escrow/settlement logic.
- Backend (Node.js/Express): Acts as a high-speed relay and Micropayment Channel (MPP). It fetches the raw data from providers, proxies it to buyers, ticks the budget counter, and submits the final cryptographically signed settlement to the blockchain.
- Frontend (Next.js/React): A beautiful, real-time dashboard for buyers to explore datasets and monitor live feeds, and for providers to track their earnings dynamically.
- Database (Neon/PostgreSQL via Prisma): Stores encrypted endpoint URIs, user metadata, and active off-chain session states.
Stellar was the perfect choice for PrivateStream for three reasons:
- Speed & Low Cost: Data streaming requires micro-transactions. Stellar's sub-penny fees and 5-second finality make pay-per-second streaming economically viable.
- Soroban Smart Contracts: Rust-based smart contracts provide the exact security and escrow capabilities needed to lock funds and guarantee fair settlement between untrusted parties.
- Confidential Tokens (Upcoming/Integration): Stellar's focus on compliance and privacy allows institutions to stream financial data without broadcasting their spending flow to competitors.
We'd love your feedback! Try out the DApp and let us know your thoughts:
- Feedback Form: Google Form Link
- Response Sheet: View Live Responses
We actively collected and implemented feedback from real users during testing. Here is a summary of our testers' experiences and the improvements we made:
| Full Name | Wallet Address (Testnet) | UI/UX Experience | Blockchain & Security | Bug Reports & Suggestions | Required Changes |
|---|---|---|---|---|---|
| Shivam Singh | GAJRNUO6HSMQG4FNHNWQVRXJZJZ7QRA7HXPYYB6H5PTA3EAAJXJNZD7U |
"Its smooth and UI feels great." | "Great application of MPP session like now I can efficiently use the dataset for my work and not have to buy entire dataset." | "No, I didn't find any" | N/A |
| Souvik Mandal | GAG3SUKHIF7VAWGTDRH52XETMLZXXNXBAZLLXHSLXAQPOBBCN43YLKR4 |
"its great no issues with it." | "Its unique, confidentiality of users is hold and instead of multiple transection we can only once and cost per second is great." | "I suggest putting more effort into the Explore Dataset section, as thereโs potential to open up a good market there. Adding proper documentation..." | 2e6bada |
| Lohit Mishra | GDYWYDOBPPM2XFQS2N7OA2XYO66C24OSBDGASSYAU7V3V4UHFIQYWCRL |
"Very clean and dark-mode aesthetic is a huge plus. The dashboard layout makes it easy to understand where my USDC is going." | "impressive" | "NA" | N/A |
| Rupam Ghosh | GBV4FZVZKT26JNLAIMGSNUDDREZLP4ESPOMDA4X6LGBTLUP5XAP73TXI |
"Listing a dataset was incredibly simple. I like that I can set my own price per second." | "The smart contract escrow gives me peace of mind that Iโll actually get paid for the data I stream." | "When I first loaded the dashboard, the 'Total Earned' took a second to refresh. Maybe add a small loading spinner inside the card while it fetches from the contract." | e8ef030 |
| Rishav Das | GBPPR5PK4B2XEXQEH5AZJJ4DGJCQAM7TKRRIQVD4J3XPLL7YY2QAJ32F |
"Good, though as someone new to Soroban, connecting Freighter took me a minute to figure out." | "Felt very secure. Transactions were smooth once the wallet was connected." | "Not really a bug, but some tooltips explaining what 'Micropayment Channel' means would be helpful for beginners." | dcbbf7f |
| Abdul Hassan | GCJWSEXMUW3B2SHKMAGKQ5ZD56V2YHHTRGYETS3WV2IN3ISXKVRWLSP7 |
"Its good giving me a product feeling." | "Its secure and its feeling like Web2 but actually working on chain." | "Na, its way better" | N/A |
| Eijah Negashi | GDT2V3UDWS2EY4LYI7CGOOV27ATSZOSYG5HGJO66UVAIIKR2MO5LXMU2 |
"It's very straight-forward" | "Streaming and giving one transection is really good I see" | "No error no bugs" | N/A |
| Varnan Chowdhury | GA4SXARZZ4RPF6N7VOAH3B5OKMFAP3FGY6M6TO3DZJL4TMU2KOVBHCIY |
"I created my dataset list, and its UI is good user friendly, but I want you to add a filter option based on price currently its only based on tag" | "Seems very efficient. Everything loaded instantly without the usual Web3 clunkiness." | "Only suggestion is to make the 'Close & Settle' button a bit more prominent so users don't forget to stop their streams!" | a730d2e e2f82cc |
| Pritam Mondal | GATJMD6BGNK4FQYNFWB354N7RP4XHA2R74GNSYM472ALNLJFX7NXBS3X |
"well design application is useful for devs" | "add other wallets too using stellar wallet sdk for intregation of various wallet not only freighter" | "No" | 2e6bada |
| Aditya Jha | GDKHLI3JCIRIKHOY5UJIVNEYGQOZXQSPE4SRWMKG7B77VAQE7SSYQMU6 |
"The streaming data preview looks fantastic." | "The zero-trust escrow model is flawless. I didn't have to worry about overpaying for a dead API endpoint." | "Na" | N/A |
Changes Implemented Based on Feedback:
- Dashboard Loading State: Added animated loading spinners to the Dashboard statistics to provide better visual feedback while fetching on-chain data (e8ef030).
- Beginner Education: Injected a detailed tooltip explaining the concept of "Micropayment Channels (MPP)" and Gasless transactions on the dataset page to help beginners understand the technology (dcbbf7f).
- Price Filtering: Added a "Max Price (USDC/s)" numeric filter to the Explore Datasets page so buyers can find streams that fit their exact budget (a730d2e).
- UI Refinements: Redesigned the "Close & Settle Session" button to use a prominent, solid red color to ensure users don't accidentally leave streams running (e2f82cc).
- Multiple Wallet Support UI: Updated the Connect Wallet button into a dropdown menu to prepare the UI for xBull and Albedo integrations, and made the full wallet address visible across all dashboards for better compliance verification (2e6bada).
- Marketplace Guidance: Added a detailed dataset onboarding banner to the Explore page to educate users on dataset monetization strategies (2e6bada).
| Landing Page | Wallet Connect |
|---|---|
A sleek, high-conversion entry point highlighting our confidential marketplace. |
Seamless authentication using Freighter wallet. |
| Explore Datasets | List Dataset |
|---|---|
Browse real-time data feeds from providers worldwide. |
Providers can list their API endpoints and set per-second pricing. |
| Live Session Stream | Provider Dashboard |
|---|---|
Buyers can watch the data stream live as their budget ticks down. |
Dynamic monitoring of total spent and earned for all sessions. |
| Vercel Analytics | Stream Transaction |
|---|---|
Production performance and analytics tracking. |
Final on-chain settlement executed securely via Soroban. |
| Mobile Dashboard | Mobile Landing |
|---|---|
Fully responsive mobile experience. |
Landing page optimized for all devices. |
PrivateStream/
โโโ api/ # Node.js Express Backend Relay
โ โโโ prisma/ # Database Schema (Neon/Postgres)
โ โโโ src/
โ โ โโโ routes/ # API endpoints (sessions, datasets)
โ โ โโโ services/ # Redis caching & Confidential Token logic
โ โ โโโ __tests__/ # Jest automated tests
โโโ app/ # Next.js 13+ Frontend App (App Router)
โ โโโ dashboard/ # Provider and Buyer analytics
โ โโโ explore/ # Dataset marketplace
โ โโโ session/ # Live data streaming view
โ โโโ onboard/ # Dataset listing flow
โโโ components/ # Reusable React components (UI)
โโโ contracts/ # Stellar Soroban Smart Contracts
โ โโโ marketplace/ # Escrow and dataset registry contract
โ โโโ src/ # Rust smart contract source code
โโโ assets/ # README screenshots and diagrams
sequenceDiagram
participant B as Buyer (Frontend)
participant A as Backend Relay (API)
participant P as Provider Endpoint
participant S as Soroban Contract
B->>S: Open Session (Lock USDC Budget)
B->>A: Request Stream (Session ID)
loop Every 2 seconds
A->>P: Fetch Live Data
P-->>A: Raw JSON Data
A->>A: Increment Spent Amount (Off-chain)
A-->>B: Stream JSON Data
end
B->>A: Close Session (Final Amount)
A->>S: Submit Final Settlement Signature
S->>S: Transfer Spent to Provider
S->>S: Refund Remainder to Buyer
- Connect Freighter Wallet.
- Go to List Dataset and enter your API endpoint URL, category, and price per second.
- The platform registers your dataset on the Soroban smart contract.
- Visit your Dashboard to watch your active sessions and total earned USDC grow in real-time.
- Connect Freighter Wallet.
- Go to Explore and browse available data feeds (e.g., DEX analytics, weather data).
- Click Open Session and approve the Soroban transaction to lock your USDC budget in escrow.
- You receive an Authorized Streaming Endpoint URI to plug into your own app, and you can view the live data feed right in the browser.
- Click Close & Settle when done; your unspent budget is instantly refunded on-chain.
- Decentralized Dataset Registry: Anyone can become a data provider by registering their API endpoint on the Soroban smart contract.
- Pay-Per-Second Streaming: Buyers only pay for the exact duration they consume data, powered by off-chain high-speed state channels.
- Gasless Meta-Transactions (Account Abstraction): Users do not need to pay Stellar network fees or constantly sign popup transactions. The backend acts as a Relayer, signing and paying for the on-chain settlement on behalf of the users, creating a seamless Web2-like experience!
- Confidential Payments: Built with Confidential Tokens in mind to ensure enterprise-grade privacy for data consumption budgets.
- Real-Time Provider Analytics: Providers get a live dashboard showing active sessions, total earnings, and recent buyers.
- Live Data Preview: Buyers can view the raw JSON data stream directly in the browser while their budget ticks down.
- Zero-Trust Escrow: Funds are securely locked on-chain and automatically settled without relying on a centralized trusted third party.
PrivateStream implements robust, production-grade error handling across the stack:
- Blockchain Timeouts: The frontend utilizes intelligent polling and
AbortSignalwith extended 25-second timeouts to account for Stellar testnet block finality delays. This ensures users never see false "API Offline" errors while a transaction is pending. - Cache Fallbacks: If the Redis cache fails (e.g., due to connection limits or permissions), the backend gracefully falls back to querying the Neon Postgres database directly, guaranteeing 100% uptime for critical data streams.
- Graceful UI Degradation: The Next.js frontend catches numeric precision errors (such as Prisma Decimal formatting limits) by strongly typing and casting all incoming data, preventing React hydration crashes.
- Smart Contract Reversions: The Soroban contract actively prevents unauthorized dataset modifications and budget over-spending using strict assertions and custom error types.
The PrivateStream marketplace relies on a secure Soroban smart contract written in Rust. It serves two main purposes: maintaining the dataset registry and acting as a trustless escrow.
Core Functions:
initialize(): Sets up the initial state and admin permissions.register_dataset(): Allows providers to list their datasets on-chain, storing metadata permanently.toggle_dataset(): Providers can pause or deactivate their datasets.get_provider_datasets(): Queries all active datasets for a specific provider wallet.- Escrow logic interacts with Confidential Tokens to securely route USDC without broadcasting amounts.
| Contract Name | Address / Hash | Network | Explorer Link |
|---|---|---|---|
| Marketplace/Escrow | CDBD72VIJTM4QNV2MR3C3OBRQUHA56PSBFSUJFRHZBYUSUOCQ5TUUNBE |
Testnet | Verify on Stellar Expert |
| Sample Escrow Transaction | 62e3c85cbe05b8b1a50fe52adbe5a362071efd50445a26fb4ad0f210b19d7dba |
Testnet | View Transaction |
When a buyer wants to stream data, they don't send money directly to the provider. Instead, they lock their budget inside our Marketplace Smart Contract (like a digital safe). While the buyer consumes data, our backend keeps a tally of the cost. When the session ends, the backend unlocks the safe, gives the exact earned amount to the provider, and returns the leftover change to the buyer. This ensures zero trust is required between the buyer and the seller!
PrivateStream maintains rigorous testing for both on-chain logic and off-chain routing.
We have a comprehensive test suite written in Rust to ensure the Soroban contract handles dataset registration and escrow securely.
cd contracts/marketplace
cargo testExpected Result: 6 passing tests ensuring state initialization and correct data storage.
We use Jest to test the critical Node.js backend logic, specifically the decimal math, budget limit enforcement, and dynamic session stat aggregation.
cd api
npm run testExpected Result: 3+ passing logic and budget enforcement tests.
- Node.js (v18+)
- Rust & Cargo (for Soroban)
- PostgreSQL Database (e.g., Neon)
- Redis (e.g., Upstash)
git clone https://github.com/shivam-s-dev/PrivateStream.git
cd PrivateStream
# Install frontend dependencies
npm install
# Install backend dependencies
cd api
npm installCreate a .env file in the root for the frontend:
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_API_URL="http://localhost:4000"
NEXT_PUBLIC_STELLAR_NETWORK="testnet"Create a .env file in the api/ folder for the backend:
DATABASE_URL="your-postgresql-url"
UPSTASH_REDIS_REST_URL="your-redis-url"
UPSTASH_REDIS_REST_TOKEN="your-redis-token"
STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
# Add your Relayer wallet secret for settlements
SETTLEMENT_RELAYER_SECRET="S..." Start the API Backend (Port 4000):
cd api
npx prisma db push
npm run devStart the Next.js Frontend (Port 3000):
# In a new terminal window
npm run devVisit http://localhost:3000 to interact with the DApp!
- ZK-Proof Verification: Allowing buyers to cryptographically verify the authenticity of the data being routed through the backend relay using Zero-Knowledge proofs.
- Dynamic Pricing Oracles: Implementing Soroban oracles to adjust the price-per-second of data feeds based on real-time network demand.
- Multi-tenant Payment Channels: Upgrading the 1-to-1 escrow to a robust Layer-2 state channel network for concurrent data streams from thousands of providers simultaneously.
- Subscription Models: Adding recurring monthly confidential subscriptions alongside the pay-as-you-go model.
Thank you to the Stellar Development Foundation and the organizers for providing the incredible Soroban smart contract platform and the opportunity to build the future of decentralized data economies. We are thrilled to present PrivateStream.






.png)

.png)




