Welcome to the SkillSphere smart contracts package! This is where all the blockchain magic happens using Stellar's powerful Soroban smart contract platform. Our contracts power a decentralized knowledge marketplace, creating a peer-to-peer consulting economy where experts and knowledge seekers connect directly without intermediaries. π
- π About The Project
- π§ Prerequisites
- βοΈ Environment Setup
- π° Wallet Configuration
- π οΈ Build & Deployment
- β Testing & Execution
- ποΈ Contract Architecture
- π Example Usage
- π€ Contributing
- π‘ Tips
- β Troubleshooting
- π Useful Links
SkillSphere is a protocol designed to democratize access to global expertise. It enables a peer-to-peer consulting economy where experts and knowledge seekers connect directly via blockchain technology.
The core innovation is "TrustFlow": a system that combines on-chain identity verification with trustless, second-by-second streaming payments. This ensures that experts are compensated fairly for their time while users only pay for the exact value they receive, eliminating the need for intermediaries or large upfront fees.
- Trust Friction: Eliminates the risk of non-payment for experts and the risk of low-quality service for users via escrow and identity reputation.
- High Fees: Removes centralized middlemen who typically take 20-30% commissions.
- Payment Inefficiency: Replaces rigid hourly billing with fluid, real-time settlement ($0.01/second).
Before starting, make sure you have the following dependencies installed:
- For Linux/macOS:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh-
For Windows: Download and install Rust from rust-lang.org.
-
Add WebAssembly Target:
rustup target add wasm32-unknown-unknown- Using Cargo:
cargo install --locked soroban-cli- Using Homebrew (macOS, Linux):
brew install soroban-cligit clone https://github.com/your-username/skillsphere-contracts.git
cd skillsphere-contractssoroban buildcargo test- Install a Stellar wallet (e.g., Freighter Wallet).
- Create a new wallet and securely store your secret keys.
- Connect the wallet to the Stellar testnet or Futurenet.
- Fund your account using the Stellar Laboratory friendbot.
cargo build --release --target wasm32-unknown-unknownmake optimize# Deploy Identity Registry
soroban contract deploy \
--wasm target/wasm32-unknown-unknown/release/identity_registry_contract.wasm \
--network testnet
# Deploy Payment Vault
soroban contract deploy \
--wasm target/wasm32-unknown-unknown/release/payment_vault_contract.wasm \
--network testnet
# Deploy other contracts similarly...cargo testcargo test --test integration_testsUse the Soroban CLI or supported wallet tools to invoke contract functions and test the full workflow.
The system is built as a set of interacting smart contracts, each handling a specific domain of the protocol.
| Contract Module | Directory | Role & Responsibility |
|---|---|---|
| Identity Registry | identity-registry-contract |
Trust & Verification. Manages expert verification status, issues Soulbound Tokens (SBTs), and maintains the ban list for bad actors. |
| Payment Vault | payment-vault-contract |
Escrow & Settlement. Securely holds user deposits and executes streaming withdrawals based on cryptographic proofs of time. |
| Manager Core | skillsphere-core-contract |
Orchestration. The main entry point for client applications. It coordinates the Registry and Vault to initialize sessions safely. |
| Scheduler | calendar-scheduling-contract |
Availability. Manages expert working hours, books time slots, and enforces cancellation policies to prevent double-booking. |
| Reputation | reputation-scoring-contract |
Incentives. Calculates and stores immutable reliability scores based on successful session completion versus disputes. |
| Asset Factory | knowledge-assets-contract |
Monetization. Mints Knowledge NFTs (course materials) and POAPs (Proof of Attendance) for gamified learning. |
- Identity-First Trust: Utilizes Soulbound Tokens (SBTs) to create a permanent, non-transferable reputation layer for experts.
- Streaming Settlement: Supports high-frequency micropayments where funds are released linearly over time.
- Session Keys: Implements ephemeral session signers, allowing client-side applications to auto-sign payment "ticks" securely without constant user manual approval.
- Trustless Escrow: Funds are locked in the
Payment Vaultduring a session and can be refunded instantly if a stream is cancelled.
For a practical example of how to interact with these contracts, check out Stellar's official documentation on Smart Contracts.
# Register an expert in the Identity Registry
soroban contract invoke \
--id <CONTRACT_ID> \
--network testnet \
-- register_expert \
--expert <EXPERT_ADDRESS> \
--metadata <METADATA_HASH>Contributions are welcome! Please follow these steps:
- Follow Rust best practices
- Ensure all tests pass before submitting
- Document your changes clearly
- Add test cases for new functionality
- Check the Issues tab for open tasks
- Fork the repository and create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes and push to the branch
- Submit a Pull Request
- Use the Soroban CLI for local development and testing
- Test thoroughly on testnet before deploying to mainnet
- Keep contract size optimized to reduce deployment costs
- Monitor gas usage for complex operations
- Use events for tracking contract state changes
- Implement proper error handling in all contract functions
- Store contract IDs in environment variables for easy management
If you encounter any issues, try these solutions:
- Compilation Errors: Ensure all dependencies are installed and updated. Run
rustup updateandcargo update. - Deployment Issues: Verify you're connected to the correct network (testnet or mainnet) and that your wallet is properly funded.
- Test Failures: Check detailed error messages from
cargo testto debug the issue. UseRUST_LOG=debug cargo testfor verbose output. - WASM Build Errors: Ensure you have the
wasm32-unknown-unknowntarget installed:rustup target add wasm32-unknown-unknown - Network Connection Issues: Verify your network configuration and RPC endpoint are correct.
For additional help, open an issue on GitHub or reach out to the maintainers.
This README is based on Stellar's official documentation.
Built with β€οΈ for the Stellar Community.
π Happy coding!