Stellar Teye is a decentralized smart contract system for secure, encrypted, and role-based management of vision care and optometry records on the Stellar blockchain using Soroban and Rust. The project enables eye care providers and patients to maintain control over sensitive vision data while ensuring privacy, immutability, and auditability. Built specifically for optometry clinics, ophthalmology practices, and vision research institutions transitioning to blockchain-based record keeping.
The platform provides a comprehensive solution for modern vision care data management, combining the security benefits of blockchain technology with practical healthcare workflows. It's designed for optometrists, ophthalmologists, vision research institutions, and patients who need to maintain confidentiality while enabling secure data sharing between authorized parties.
- Project Overview
- Setup Instructions
- Features
- Project Structure
- Usage Examples
- Deployment
- CI/CD Pipeline
- Helpful Links
- Contribution Guidelines
- License
- Compliance Documentation - HIPAA compliance and regulatory requirements
- Support
Stellar Teye transforms vision care record management by leveraging Stellar's blockchain infrastructure to create an immutable, secure, and patient-centric eye care data ecosystem. The system addresses critical healthcare challenges including data breaches, interoperability issues, and patient privacy concerns through cryptographic security and decentralized governance.
| Benefit | Description |
|---|---|
| Enhanced Security | Military-grade encryption protects sensitive vision data |
| Patient Control | Patients grant and revoke access to their records |
| Interoperability | Standardized format enables seamless data exchange |
| Audit Trail | Complete, immutable history of all record access and modifications |
| Vision-Specific | Tailored for optometry and ophthalmology workflows |
- Optometry clinics and ophthalmology practices
- Vision research institutions
- Eye care insurance providers
- Patients seeking control over their vision data
- Optical retail chains and laboratories
Before you begin, ensure you have the following installed:
- Rust 1.78.0+ - Install Rust
- Soroban CLI v23.1.4+ - Install Soroban
- Git - For version control
- Make - For using the provided Makefile (optional but recommended)
Get up and running in under 5 minutes:
# Clone the repository
git clone https://github.com/Stellar-Teye/Teye-Contracts.git
cd Teye-Contracts
# Run the automated setup script
chmod +x setup.sh
./setup.sh
# Or use the Makefile for step-by-step setup
make setupThe setup.sh script handles everything automatically:
./setup.shThis script will:
- Install Rust 1.78.0 and required targets
- Install Soroban CLI v23.1.4
- Set up project structure
- Configure Soroban networks (local, testnet, futurenet)
- Build the project and run tests
- Generate default identity
# Install Rust targets and components
rustup target add wasm32-unknown-unknown
rustup component add rustfmt clippy rust-src
# Install Soroban CLI
cargo install --locked soroban-cli
# Configure Soroban
soroban config identity generate default
soroban config network add local \
--rpc-url http://localhost:8000/soroban/rpc \
--network-passphrase "Standalone Network ; February 2017"
# Build the project
cargo build --all-targets
# Run tests to verify setup
cargo test --allEnsure everything is working correctly:
# Run all tests
make test
# Or use cargo directly
cargo test --all
# Run specific test types
make test-unit # Unit tests only
make test-integration # Integration tests onlyThe project supports multiple Stellar networks:
# Start local development network
make start-local
# or
soroban network start local
# Deploy to local network
make deploy-local
# Stop local network
make stop-localAvailable Networks:
| Network | URL | Purpose |
|---|---|---|
| Local | http://localhost:8000/soroban/rpc |
Development |
| Testnet | https://soroban-testnet.stellar.org:443 |
Testing |
| Futurenet | https://rpc-futurenet.stellar.org:443 |
Staging |
- Encrypted on-chain vision care records storage
- Role-based access control (patients, optometrists, ophthalmologists, admins)
- Immutable timestamping and full history tracking
- Comprehensive eye exam and prescription data management
- Public key-based identity verification
- Fully testable, modular, and CI-enabled
- Gas-efficient contract design
- Decentralized governance with Governor + Timelock (proposals, voting, queued execution)
- Vision health analytics and trend tracking
- Multi-provider record sharing
- AI-powered vision analysis integration with provider verification and anomaly flagging
Teye-Contracts/
│
├── contracts/
│ └── vision_records/
│ ├── src/
│ │ └── lib.rs # Main contract logic
│ └── Cargo.toml # Contract dependencies
│
├── scripts/ # Deployment and interaction scripts
│ ├── deploy.sh # Contract deployment
│ ├── interact.sh # Contract interaction
│ └── test_scripts/ # Test utilities
│
├── tests/
│ ├── integration/ # Integration tests
│ └── unit/ # Unit tests
│
├── docs/ # Documentation
│ ├── api.md # API reference
│ └── architecture.md # Architecture details
│
├── .github/
│ └── workflows/
│ └── ci.yml # Continuous integration
│
├── setup.sh # Automated setup script
├── Makefile # Build automation
├── Dockerfile # Docker support
├── Cargo.toml # Workspace configuration
└── README.md # This file
// Register a new patient
let patient_id = client.register_patient(&env, &patient_address, &patient_data);
// Add a vision exam record
let record_id = client.add_exam_record(&env, &patient_id, &exam_data);
// Grant access to an optometrist
client.grant_access(&env, &patient_id, &optometrist_address, &AccessLevel::Read);
// Retrieve vision records
let records = client.get_patient_records(&env, &patient_id);# Build all contracts
make build
# Run all tests
make test
# Deploy to testnet
make deploy-testnet
# Generate documentation
make docsmake deploy-local# Configure testnet identity
soroban config identity generate deployer
# Fund the account (use Stellar Laboratory)
# Deploy contracts
make deploy-testnet# Ensure all tests pass
make test
# Build optimized contracts
make build-release
# Deploy to mainnet (requires proper key management)
make deploy-mainnet| Workflow | Trigger | Purpose |
|---|---|---|
ci.yml |
Push/PR | Build, test, lint |
security.yml |
Push/PR/Daily | Security scanning |
deploy-testnet.yml |
Push to develop | Auto-deploy to testnet |
deploy-mainnet.yml |
Manual | Production deployment |
# Deploy with rollback support
./scripts/deploy_with_rollback.sh testnet
# Monitor deployment status
./scripts/monitor_deployments.sh
# Check deployment status
./scripts/deployment_status.shWe welcome contributions! Please follow these guidelines:
Start with the Contributor Onboarding guide for a full setup and first-PR walkthrough.
- Fork the repository
- Clone your fork locally
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test your changes:
cargo test --all - Commit with a descriptive message
- Push to your fork
- Submit a Pull Request
# Create a feature branch
git checkout -b feature/issue-number-description
# Make changes and test
cargo fmt
cargo clippy
cargo test --all
# Commit changes
git commit -m "feat: description of changes (closes #issue-number)"
# Push and create PR
git push origin feature/issue-number-description- Follow Rust style guidelines (
cargo fmt) - Pass all Clippy lints (
cargo clippy) - Write tests for new functionality
- Update documentation as needed
- Use conventional commit messages
- All PRs require at least one approval
- CI must pass before merging
- Maintain test coverage above 80%
- Address all review comments
- Code compiles without warnings
- All tests pass
- Documentation updated
- PR description is complete
- Linked to relevant issue
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Discord: Join our Discord
Built with on Stellar