Proof of Concept - Zephyr Integration for Trustless Work Indexing
Issue Details
Task: Proof of Concept - Zephyr Integration for Trustless Work Indexing
Objective
The goal of this PoC is to explore how Zephyr (Mercury's cloud execution environment) can be used to index Trustless Work escrows on the Stellar network. This requires investigating the Zephyr VM's capabilities, defining an approach to ingest escrow-related data, and mapping out the necessary implementation steps.
Scope
- Research ZephyrVM and its custom indexing capabilities.
- Identify how to extract and store escrow-related events from Soroban smart contracts.
- Define the custom API endpoints needed to query indexed escrows.
- Explore external integrations, such as webhooks for real-time monitoring of escrow changes.
- Document an architecture proposal for how Zephyr can be used to index and retrieve escrow data.
Key Research Questions
-
Data Access
- What ledger data and contract events related to escrows can Zephyr retrieve?
- Can Zephyr read escrow contract state changes (e.g., funding, milestone updates, approvals, releases)?
- What is the best way to track escrow lifecycle events efficiently?
-
Storage & Retrieval
- How does Zephyr structure indexed data?
- What kind of database interactions does Zephyr allow?
- How can indexed escrows be queried efficiently from Mercury?
-
Custom API & External Calls
- Can we set up custom API endpoints for querying escrows?
- How does Zephyr handle webhooks and external service interactions?
- What would be the best approach to serve indexed escrow data?
-
Performance & Real-Time Processing
- How does Zephyr handle real-time event ingestion?
- What are the performance considerations for indexing a high volume of escrows?
- Are there any latency concerns for near-instant queries?
Proposed Steps
-
Understand Zephyr SDK & APIs
- Read the Zephyr documentation and understand how it interacts with Soroban smart contracts.
- Review Zephyr's built-in Soroban support for reading contract state.
-
Define Data Mapping for Escrows
- Identify which escrow contract fields need to be indexed.
- Determine how escrow status updates (funded, in review, released) can be tracked.
- Define the structure for storing indexed escrows.
-
Prototype Zephyr Rust Program
- Set up a basic Zephyr Rust program that retrieves escrow contract data.
- Experiment with querying ledger close data and escrow state changes.
- Store sample indexed data in Mercury’s database.
-
Design Custom API & Retrieval Logic
- Test setting up Zephyr callable APIs to query escrow status.
- Explore potential alert mechanisms for escrow updates (e.g., webhook triggers).
-
Document Findings & Next Steps
- Summarize key learnings and any roadblocks.
- Outline next steps for full integration.
Deliverables
✅ Zephyr Research Report (summary of findings on feasibility, indexing strategy, and API design)
✅ Escrow Data Mapping Document (list of contract fields to index, API structure)
✅ Rust Code Prototype (basic implementation for fetching escrow contract data)
✅ Next Steps Proposal (recommendations for full integration)
Technical Notes
- Zephyr programs are Rust-based and execute in a sandboxed WebAssembly VM.
- Zephyr integrates natively with Soroban, allowing contract state reads.
- Event-based indexing might be preferred over polling for efficiency.
- Data storage is fully customizable, enabling custom queries and aggregations.
Expected Timeline
⏳ 5-7 days for research and initial PoC.
Resources
📖 Zephyr Docs: [Mercury Zephyr Documentation](https://docs.mercurydata.app/zephyr-full-customization/introduction)
🔗 GitHub Toolkit: [Zephyr Rust SDK](https://github.com/xycloo/rs-zephyr-toolkit)
This PoC will help determine whether Zephyr is a viable solution for real-time escrow indexing and how it can enhance Trustless Work’s ecosystem. 🚀
Issue Details
Proof of Concept - Zephyr Integration for Trustless Work Indexing
Task: Proof of Concept - Zephyr Integration for Trustless Work Indexing
Objective
The goal of this PoC is to explore how Zephyr (Mercury's cloud execution environment) can be used to index Trustless Work escrows on the Stellar network. This requires investigating the Zephyr VM's capabilities, defining an approach to ingest escrow-related data, and mapping out the necessary implementation steps.
Scope
- Research ZephyrVM and its custom indexing capabilities.
- Identify how to extract and store escrow-related events from Soroban smart contracts.
- Define the custom API endpoints needed to query indexed escrows.
- Explore external integrations, such as webhooks for real-time monitoring of escrow changes.
- Document an architecture proposal for how Zephyr can be used to index and retrieve escrow data.
Key Research Questions
-
Data Access
- What ledger data and contract events related to escrows can Zephyr retrieve?
- Can Zephyr read escrow contract state changes (e.g., funding, milestone updates, approvals, releases)?
- What is the best way to track escrow lifecycle events efficiently?
-
Storage & Retrieval
- How does Zephyr structure indexed data?
- What kind of database interactions does Zephyr allow?
- How can indexed escrows be queried efficiently from Mercury?
-
Custom API & External Calls
- Can we set up custom API endpoints for querying escrows?
- How does Zephyr handle webhooks and external service interactions?
- What would be the best approach to serve indexed escrow data?
-
Performance & Real-Time Processing
- How does Zephyr handle real-time event ingestion?
- What are the performance considerations for indexing a high volume of escrows?
- Are there any latency concerns for near-instant queries?
Proposed Steps
-
Understand Zephyr SDK & APIs
- Read the Zephyr documentation and understand how it interacts with Soroban smart contracts.
- Review Zephyr's built-in Soroban support for reading contract state.
-
Define Data Mapping for Escrows
- Identify which escrow contract fields need to be indexed.
- Determine how escrow status updates (funded, in review, released) can be tracked.
- Define the structure for storing indexed escrows.
-
Prototype Zephyr Rust Program
- Set up a basic Zephyr Rust program that retrieves escrow contract data.
- Experiment with querying ledger close data and escrow state changes.
- Store sample indexed data in Mercury’s database.
-
Design Custom API & Retrieval Logic
- Test setting up Zephyr callable APIs to query escrow status.
- Explore potential alert mechanisms for escrow updates (e.g., webhook triggers).
-
Document Findings & Next Steps
- Summarize key learnings and any roadblocks.
- Outline next steps for full integration.
Deliverables
✅ Zephyr Research Report (summary of findings on feasibility, indexing strategy, and API design)
✅ Escrow Data Mapping Document (list of contract fields to index, API structure)
✅ Rust Code Prototype (basic implementation for fetching escrow contract data)
✅ Next Steps Proposal (recommendations for full integration)
Technical Notes
- Zephyr programs are Rust-based and execute in a sandboxed WebAssembly VM.
- Zephyr integrates natively with Soroban, allowing contract state reads.
- Event-based indexing might be preferred over polling for efficiency.
- Data storage is fully customizable, enabling custom queries and aggregations.
Expected Timeline
⏳ 5-7 days for research and initial PoC.
Resources
📖 Zephyr Docs: [Mercury Zephyr Documentation](https://docs.mercurydata.app/zephyr-full-customization/introduction)
🔗 GitHub Toolkit: [Zephyr Rust SDK](https://github.com/xycloo/rs-zephyr-toolkit)
This PoC will help determine whether Zephyr is a viable solution for real-time escrow indexing and how it can enhance Trustless Work’s ecosystem. 🚀