### Terms and Conditions
- [x] I agree to the [Grant Agreement](https://9ba4718…c-5c73-47c3-a024-4fc4e5278803.usrfiles.com/ugd/9ba471_f81ef4e4b5f040038350270590eb2e42.pdf) terms if funded
- [x] I agree to [Provide KYC information](https://9ba4718c-5c73-47c3-a024-4fc4e5278803.usrfiles.com/ugd/9ba471_7d9e73d16b584a61bae92282b208efc4.pdf) if funded above $50,000 USD
- [x] I agree to disclose conflicts of interest
- [x] I agree to adhere to the [Code of Conduct](https://forum.zcashcommunity.com/t/zcg-code-of-conduct/41787) and [Communication Guidelines](https://forum.zcashcommunity.com/t/zcg-communication-guidelines/44284)
- [x] I understand all milestone deliverables will be validated and accepted by their intended users or their representatives, who will confirm that the deliverables meet the required quality, functionality, and usability for each user story.
- [x] I agree that for any new open-source software, I will create a `CONTRIBUTING.md` file that reflects the high standards of Zcash development, using the [`librustzcash` style guides](https://github.com/zcash/librustzcash/blob/main/CONTRIBUTING.md#styleguides) as a primary reference.
- [x] I understand when contributing to existing Zcash code, I am required to adhere to the project specific contribution guidelines, paying close attention to any [merge](https://github.com/zcash/librustzcash/blob/main/CONTRIBUTING.md#merge-workflow), [branch](https://github.com/zcash/librustzcash/blob/main/CONTRIBUTING.md#branch-history), [pull request](https://github.com/zcash/librustzcash/blob/main/CONTRIBUTING.md#pull-request-review), and [commit](https://github.com/zcash/librustzcash/blob/main/CONTRIBUTING.md#commit-messages) guidelines as exemplified in the `librustzcash` repository.
- [x] I agree to post request details on the [Community Forum](https://forum.zcashcommunity.com/c/grants/33)
- [x] I understand it is my responsibility to post a link to this issue on the [Zcash Community Forums](https://forum.zcashcommunity.com/c/grants/33) after this application has been submitted so the community can give input. I understand this is required in order for ZCG to discuss and vote on this grant application.
### Application Owners (@Octocat, @Octocat1)
Collinsville22
### Organization Name
Collins
### How did you learn about Zcash Community Grants
From my researchh about zcash communities
### Requested Grant Amount (USD)
100,000
### Category
Non-Wallet Applications
### Project Lead
```project-lead.yaml
Name:Collins
Role:Solo Dev
Background:
Responsibilities:Making all this possible
```
### Additional Team Members
```team-members.yaml
None
```
### Project Summary
Privacy Bridge lets Zcash holders use their ZEC as collateral to borrow USDC on NEAR Protocol, plus access staking yields and cross-chain payments—all without selling their ZEC.
### Project Description
Privacy Bridge connects Zcash to NEAR Protocol's DeFi ecosystem. The core product is a ZEC/USDC lending market where users deposit ZEC as collateral and borrow stablecoins against it.
Here's what we've built:
ZEC/USDC Lending Market - Users bridge ZEC to NEAR via Defuse, then deposit it as collateral in our lending contract. They can borrow USDC against their ZEC position. Interest rates adjust dynamically based on utilization. Prices come from Pyth Oracle. The smart contract tracks positions, calculates interest, and handles liquidations.
Cross-Chain Staking - Users can convert their ZEC to stake on other chains. We use NEAR Chain Signatures to derive addresses on Solana, Ethereum, and NEAR itself. ZEC gets swapped via OneClick to the native token, then staked in protocols like Marinade (mSOL), Jito (jitoSOL), Lido (stETH), or Linear (LiNEAR).
Payment System - Recipients create payment requests specifying a ZEC shielded address and USD amount. Senders can pay with any supported token—OneClick handles the swap and delivers ZEC to the recipient's shielded address.
Trading Integration - Users can deposit ZEC to trade on Polymarket (prediction markets) or Hyperliquid (perpetual futures). ZEC converts to USDC on Polygon or Arbitrum, then users trade using derived addresses signed via Chain Signatures MPC.
The infrastructure is working. Smart contracts are deployed on testnet. The backend handles all the cross-chain coordination.
Demo video: https://www.youtube.com/watch?v=h4VhNNEHBAg
GitHub: https://github.com/collinsville22/privacybridge
### Proposed Problem
Zcash has a liquidity problem. ZEC holders can't do much with their coins besides hold, spend, or swap.
The Zashi Wallet integration with NEAR Intents proved demand exists. When users discovered they could swap into shielded ZEC, NEAR Intents volume spiked past $40M daily. But it dropped back to $5-13M because there's nothing to do after the swap.
The real problem: ZEC holders want to earn yield on their holdings without selling. They want to borrow against their ZEC when they need liquidity. They want to participate in DeFi. But most protocols don't support Zcash because it's technically complex and lives on its own chain.
So billions of dollars in ZEC sits idle while other assets generate returns.
### Proposed Solution
Proposed Solution
We built a ZEC/USDC lending market on NEAR Protocol.
How it works:
1. User bridges ZEC to NEAR using Defuse Bridge
2. They receive ZEC tokens in the NEAR Intents contract (intents.near)
3. User deposits ZEC as collateral in our lending market contract
4. They can borrow up to ~65% of their collateral value in USDC
5. Interest accrues based on market utilization (dynamic rates from Pyth Oracle prices)
6. User repays USDC + interest whenever they want
7. They withdraw their ZEC collateral
8. They can bridge back to native ZEC via Defuse
The lending contract handles everything on-chain: position tracking, interest calculation, collateral management, liquidations if positions go underwater.
Beyond lending, users can also:
- Stake their ZEC across chains (Marinade, Jito, Lido, Linear)
- Receive payments in ZEC from any token
- Trade on Polymarket and Hyperliquid using ZEC as the funding source
All of this uses Chain Signatures MPC for cross-chain operations—no centralized key custody.
### Solution Format
Smart Contracts (Rust/NEAR SDK):
- LendingMarket contract - handles collateral deposits, borrowing, repayments, liquidations, interest accrual
- Token contract - NEP-141 wrapped ZEC (nZEC)
- Bridge contract - minting/burning coordination
Backend Services (TypeScript/Fastify):
- Lending service - market stats, position queries, rate calculations, Pyth Oracle integration
- Staking service - cross-chain staking via Chain Signatures, position tracking
- Payment service - payment request creation, OneClick quote generation, deposit monitoring
- Trading services - Polymarket and Hyperliquid API integration
- Defuse client - ZEC bridging, deposit address generation, withdrawal tracking
- Intents client - NEAR Intents contract interaction for ZEC transfers
Frontend (Next.js):
- Lending dashboard - supply ZEC, borrow USDC, manage positions
- Staking interface - stake across protocols
- Payment links - create and share payment requests
- Trading UI - Polymarket and Hyperliquid interfaces
Infrastructure:
- PostgreSQL for position and transaction tracking
- Redis for job queues and caching
### Dependencies
Dependencies
External Services:
- Defuse Bridge - ZEC to NEAR bridging (https://defuse.org)
- NEAR Intents - Multi-token contract holding bridged ZEC
- Pyth Oracle - Price feeds for ZEC/USD, USDC/USD via Hermes API
- OneClick SDK - Cross-chain swaps for staking and payments
- Chain Signatures - NEAR's MPC for cross-chain transaction signing
Blockchain Infrastructure:
- NEAR RPC - Contract interactions
Technical Dependencies:
- near-api-js / near-sdk-rs - NEAR development
- PostgreSQL - State management
- Redis + BullMQ - Background job processing
No blocking dependencies. All external services we use are production and publicly available.
### Technical Approach
Technical Approach
Lending Market Architecture:
The lending contract (contracts/lending-market) implements:
- PoolState - tracks total supplied and borrowed amounts
- BorrowPosition - individual positions with collateral, borrow amount, accrued interest
- SupplyPosition - supplier deposits with active amount and pending yield
- InterestCalculator - dynamic rate calculation based on utilization
Key parameters:
- Collateral factor: ~65% (borrow up to 65% of collateral value)
- Liquidation threshold: ~80%
- Snapshot interval: 1 hour (for accurate interest calculation)
- Max positions per account: 10
Price Oracle Integration:
We use Pyth Network for price feeds:
- ZEC/USD: be9b59d178f0d6a97ab4c343bff2aa69caa1eaae3e9048a65788c529b125bb24
- USDC/USD: eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a
Prices fetched from Hermes API and submitted on-chain for position valuation.
ZEC Bridging Flow:
1. User calls Defuse RPC deposit_address(account_id, 'zcash') to get deposit address
2. User sends ZEC to that address
3. Defuse bridge processes deposit (typically 10 confirmations)
4. ZEC appears in user's NEAR Intents balance (intents.near contract)
5. User calls mt_transfer_call to move ZEC to lending market as collateral
Withdrawal Flow:
1. User withdraws collateral from lending market
2. User calls mt_transfer_call on intents contract with withdrawal message:
{"type": "withdraw", "receiver": "zs1...", "chain": "zec:mainnet"}
3. Defuse processes withdrawal to native ZEC address
Cross-Chain Staking:
Uses NEAR Chain Signatures for MPC-based signing:
1. Derive address on target chain (Solana/Ethereum/NEAR) from user's NEAR account
2. Create OneClick quote: ZEC -> native token (SOL/ETH/NEAR)
3. Execute swap via OneClick
4. Build staking transaction for target protocol
5. Sign via Chain Signatures MPC
6. Broadcast to target chain
7. Track staked position in database
Payment System:
1. Recipient creates request with ZEC shielded address + USD amount
2. Sender selects payment token, gets OneClick quote
3. Sender deposits to OneClick address
4. OneClick swaps to ZEC and delivers to recipient's shielded address
5. Backend tracks status via OneClick execution API
Stack:
- Backend: Node.js 20, Fastify, TypeScript, Prisma, PostgreSQL, Redis, BullMQ
- Frontend: Next.js 14, React 18, TailwindCSS, NEAR Wallet Selector
- Contracts: Rust, near-sdk 5.5
- Bridging: Defuse Bridge, OneClick SDK
- Signing: NEAR Chain Signatures MPC
### Upstream Merge Opportunities
Privacy Bridge does not fork Zcash core software. We integrate with existing infrastructure:
Potential ecosystem contributions:
1. Defuse integration patterns - Our implementation of the Defuse RPC client for deposits and withdrawals could serve as reference code for other projects wanting to bridge ZEC.
2. Shielded address validation - We validate Sapling (zs...) and Unified (u...) addresses. This validation logic could be extracted as a standalone library.
3. Lending market reference - Our ZEC collateral lending implementation could be a template for other ZEC DeFi projects.
No upstream changes required. We're building on top of existing Zcash infrastructure, not modifying it. Any contributions would be new tooling or documentation, not core protocol changes.
### Hardware/Software Costs (USD)
10,000
### Hardware/Software Justification
Hardware/Software Justification
Cloud infrastructure ($7,000 for 12 months):
- NEAR RPC node access or FastNear subscription
- PostgreSQL database hosting (managed, with backups)
- Redis instance for job queues
- Application servers (2x for redundancy)
Zcash infrastructure ($2,000):
- Zebra full node hosting (500GB+ storage)
- Zaino indexer instance
Development tools ($1,000):
- Domain, SSL certificates
- Monitoring (error tracking, uptime monitoring)
- CI/CD pipeline costs
### Service Costs (USD)
25,000
### Service Costs Justification
Service Costs Justification
Smart contract security audit ($18,000):
Professional audit of the lending market contract. This is critical—the contract handles user collateral and borrowing logic. Need thorough review of:
- Interest calculation correctness
- Liquidation logic
- Overflow/underflow protection
- Access control
- Reentrancy protection
Budgeting for a mid-tier audit firm with DeFi experience.
Penetration testing ($4,000):
External security assessment of:
- Backend API endpoints
- Authentication flow
- Cross-chain signing integration
- Database security
Legal consultation ($3,000):
Basic legal review of terms of service and regulatory considerations for operating a lending protocol.
### Compensation Costs (USD)
65,000
### Compensation Costs Justification
Lead Developer - $10,800/month × 6 months = $65,000
Full-time development work covering:
- Audit preparation and remediation
- Mainnet deployment and testing
- Lending market optimization and monitoring
- DeFi protocol integrations (getting nZEC listed as collateral elsewhere)
- User support and documentation
- Bug fixes and maintenance
This is one senior blockchain developer working full-time. Rate reflects the specialized skills required (Rust smart contracts, cross-chain systems, DeFi mechanics)
### Total Budget (USD)
10,000
### Previous Funding
No
### Previous Funding Details
_No response_
### Other Funding Sources
No
### Other Funding Sources Details
_No response_
### Implementation Risks
Implementation Risks
Smart contract bugs:
The lending contract handles real funds. Any bug in interest calculation, liquidation logic, or access control could result in losses.
Mitigation: Professional audit, extensive testnet testing, staged mainnet rollout with deposit caps, bug bounty program.
Oracle manipulation:
If Pyth price feeds are manipulated, positions could be incorrectly liquidated or users could borrow more than they should.
Mitigation: Use Pyth's confidence intervals, implement sanity checks on price movements, add time-weighted average price (TWAP) as backup.
Bridge risks:
We depend on Defuse Bridge for ZEC<->NEAR transfers. If Defuse has issues, deposits or withdrawals could be delayed or fail.
Mitigation: Clear user communication about bridge status, implement deposit monitoring and alerts, maintain relationship with Defuse team.
Low liquidity:
If not enough USDC is supplied to the lending pool, borrowers can't get loans.
Mitigation: Bootstrap initial liquidity, offer competitive supply APY, partner with liquidity providers.
Regulatory uncertainty:
DeFi lending and privacy coins both face regulatory scrutiny.
Mitigation: No KYC requirement but also no marketing toward illicit use, legal consultation, prepared to adapt if regulations change.
### Potential Side Effects
Liquidation cascades:
If ZEC price drops sharply, many positions could get liquidated at once, potentially causing further price pressure.
Mitigation: Conservative collateral ratios, gradual liquidation mechanism, circuit breakers for extreme volatility.
Centralization of ZEC liquidity:
If Privacy Bridge becomes popular, significant ZEC could be locked in the protocol, reducing liquidity elsewhere.
Actual effect: This is generally positive for Zcash—it means ZEC is being used productively rather than sitting idle.
Dependency on external services:
We rely on Defuse, OneClick, Pyth, and Chain Signatures. Issues with any of these affect our users.
Mitigation: Monitor all dependencies, have fallback plans, clear communication when issues arise.
### Success Metrics
Primary metrics (6 months post-mainnet):
- Total Value Locked: $500,000+ ZEC deposited as collateral
- Active loans: $200,000+ USDC borrowed against ZEC
- Monthly active users: 500+ unique addresses
- Utilization rate: 40-60% (healthy lending market)
Secondary metrics:
- Zero security incidents with loss of funds
- Average position health factor: >1.5 (healthy collateralization)
- Liquidation rate: <5% of positions (users managing risk well)
- 99.9% uptime for deposit/withdrawal processing
Measurement:
- On-chain data from NEAR contracts (publicly verifiable)
- Internal monitoring dashboards
- Monthly transparency reports published to community
### Startup Funding (USD)
35,000
### Startup Funding Justification
Startup funding gets us from prototype to audited, mainnet-ready code.
Security audit ($18,000):
Can't launch without professional review of the lending contract. This is the biggest single expense and most important.
Initial infrastructure ($7,000):
Set up production servers, Zcash nodes, databases. Need this running before final testing.
Development time ($10,000):
One month of work to prepare codebase for audit (documentation, test coverage, code cleanup), coordinate with auditors, address initial findings.
This milestone ends with: audited contracts, production infrastructure ready, comprehensive documentation.
### Milestone Details
```milestones.yaml
- Milestone: 1
Amount (USD): 35000
Expected Completion Date: 2025-09-30
User Stories:
- "As a ZEC holder, I want to know the lending contracts have been professionally audited, so that I can trust my collateral is safe"
- "As a security researcher, I want access to the codebase and bug bounty program, so that I can help identify vulnerabilities"
- "As a developer, I want comprehensive documentation, so that I can understand how the protocol works"
Deliverables:
- Published security audit report from reputable firm covering lending market contract
- Penetration testing report for backend API
- Bug bounty program launched with clear scope and rewards
- Production infrastructure deployed (NEAR contracts on testnet, Zcash nodes, databases)
- Technical documentation covering architecture, API endpoints, and contract interfaces
- Public testnet with at least 50 community members completing test deposits and borrows
Acceptance Criteria: Audit report published with no unresolved critical or high severity findings. Testnet live and functional. Documentation complete and reviewed by at least 3 external developers.
- Milestone: 2
Amount (USD): 35000
Expected Completion Date: 2025-11-30
User Stories:
- "As a ZEC holder, I want to deposit my ZEC as collateral and borrow USDC, so that I can access liquidity without selling my Zcash"
- "As a lender, I want to supply USDC to the lending pool, so that I can earn interest on my stablecoins"
- "As a borrower, I want to see my position health and interest accrued, so that I can manage my risk"
Deliverables:
- Mainnet deployment of lending market contract on NEAR
- ZEC/USDC lending market live with real deposits and borrows
- Web application deployed with lending dashboard
- Pyth Oracle integration for live ZEC/USDC prices
- Position management UI showing health factor, interest, liquidation price
- Real-time monitoring and alerting for protocol health
Acceptance Criteria: Mainnet processing real transactions. At least $100,000 TVL in first 30 days. Lending and borrowing functions working correctly with accurate interest calculation. No security incidents.
- Milestone: 3
Amount (USD): 30000
Expected Completion Date: 2026-01-31
User Stories:
- "As a Zcash community member, I want easy-to-follow guides, so that I can start using the lending market"
- "As a DeFi user, I want to use my ZEC across multiple protocols, so that I have more options for yield"
- "As a ZEC holder, I want to earn staking yields, so that my ZEC generates passive income"
Deliverables:
- Integration with at least one additional NEAR DeFi protocol accepting nZEC
- Cross-chain staking feature live (Marinade, Lido, or Linear integration)
- Comprehensive user tutorials and video guides
- Zcash community outreach completed (forum posts, Discord engagement)
- Public analytics dashboard showing TVL, utilization, rates
- Growth to target metrics (500K TVL, 500 MAU)
Acceptance Criteria: $500,000+ TVL achieved. 500+ monthly active users. Second DeFi integration live. Staking feature operational. Active community presence in Zcash channels.
```
### Supporting Documents
```files.yaml
- Demo Video: https://www.youtube.com/watch?v=h4VhNNEHBAg - Full walkthrough showing ZEC deposit, lending market interaction, and withdrawal flow
- GitHub Repository: https://github.com/collinsville22/privacybridge - Complete source code including smart contracts, backend, and frontend (MIT license)
```