Visualize Account Update (Issue #14)
Project Background
The Mina Protocol enables complex transactions resulting in multiple account updates, including token transfers, state changes, and delegation modifications. Currently, developers can view these updates in JSON format using the toPretty() function. However, as transactions become more intricate, the JSON output becomes difficult to interpret, especially for transactions involving multiple accounts or complex smart contract interactions.
This project aims to develop a VSCode extension that integrates with JSON Crack to create a powerful transaction visualization tool that will:
- Generate and visually represent account update JSONs within VSCode
- Allow developers to easily understand transaction structures without network deployment
- Facilitate debugging of complex smart contract interactions
- Leverage JSON Crackβs advanced visualization capabilities
By creating a more intuitive way to visualize and comprehend transaction structures directly within the development environment, this tool will significantly enhance the development experience on the Mina Protocol, addressing a key need identified by the developer community.
Proposal Overview
Problem
Complex transactions in the Mina Protocol result in JSON outputs that are difficult to interpret, especially for transactions involving multiple accounts or intricate smart contract interactions. This hinders developersβ ability to understand and debug their transactions efficiently within their development environment.
Solution
Develop a VSCode extension that integrates with JSON Crack to visually represent account updates and transaction structures. This tool will transform complex JSON outputs into intuitive, interactive graph visualizations directly within VSCode.
Impact
This proposal will significantly enhance the Mina ecosystem by:
- Improving developer productivity and reducing debugging time by providing in-editor visualization
- Lowering the barrier to entry for new developers in the Mina ecosystem
- Enabling more complex and innovative applications by making intricate transactions easier to understand and implement
- Leveraging the power of JSON Crack to provide advanced visualization features for Mina transactions
Audience
The primary target audience includes:
- Mina Protocol developers working on smart contracts and complex transactions
- New developers entering the Mina ecosystem
- Blockchain explorers and wallet developers in the Mina ecosystem who can adapt this tool for their needs
Architecture & Design
Detailed Design/Architecture
The proposed VSCode extension for Mina Transaction Visualization will integrate with JSON Crack and focus on the following components:
-
State Analyzer:
- Code Parser: Extracts account states from the code using the VSCode extension.
- State Transition Detector: Identifies changes between states. We envision it more than just a debugger. The extension would attempt to simulate the txns/account updates while the test runs and/or while the code is being written and print the transitions next to the code with an option to double click and drill down further if needed
- Relationship Builder: Creates relationships between state variables
-
JSON Crack Integration:
- Data Formatter: Converts analyzed data into JSON Crack compatible format
- Visualization Engine: Generates the interactive graph using JSON Crack
- Export Functions: Allows exporting the visualization as images or data. All attempts would be made to cover probable dev environments.
-
VSCode Extension Interface:
- WebView: Displays the JSON Crack visualization within VSCode
- User Interaction Handlers: Manages code selection, analysis triggering, and graph interaction.
Diagram 1: High Level Design of Information Flow
Diagram 2: Example UI
Vision
Our vision for this project is to create a seamless, in-editor transaction visualization tool that significantly improves the Mina development experience. Key aspects of this vision include:
- Seamless Integration: Providing visualization capabilities directly within VSCode, where developers spend most of their time.
- Enhanced Detail: Offering comprehensive and easily digestible information about each AccountUpdate and its components.
- Interactivity: Leveraging JSON Crackβs interactive features for a dynamic exploration of transaction structures.
- Export Options: Enabling developers to easily share and incorporate transaction visualizations into their documentation and discussions.
By realizing this vision, we aim to improve the developer experience and contribute to the growth of the Mina ecosystem. This VSCode extension will serve as a powerful tool in the Mina development toolkit.
Deliverables
Mid-Point Milestones (1 month):
-
State Analyzer:
- Completed Code Parser for extracting account states
- Implemented State Transition Detector
- Basic Relationship Builder functionality
-
VSCode Extension (Basic Version):
- Functional VSCode extension with WebView
- Ability to select code and trigger analysis
- Basic integration with JSON Crack for visualization
-
JSON Crack Integration (Partial):
- Data Formatter for converting to JSON Crack format
- Basic interactive graph generation within VSCode
Project Timeline: 2 Months
Week 1-2:
- Develop State Analyzer components
- Set up VSCode extension project structure
Week 3-4:
- Implement basic VSCode extension functionality
- Begin JSON Crack integration
- Mid-point review and adjustments
Week 5-6:
- Enhance JSON Crack integration with advanced features
- Implement export functionalities
- Comprehensive testing and bug fixes
Final 2 weeks:
- Final polishing of UI/UX within VSCode
- Documentation writing
- Preparation for VSCode Marketplace deployment
Budget Requested: 45,000 MINA
Budget Breakdown:
-
Development Costs: 35,000 MINA
- State Analyzer Development: 12,000 MINA
- VSCode Extension Development: 13,000 MINA
- JSON Crack Integration: 10,000 MINA
-
Testing and Quality Assurance: 5,000 MINA
-
Documentation and Deployment: 3,000 MINA
-
Project Management: 2,000 MINA
Wallet Address:
B62qrF8xMKPPQMCwK2J7Ey47CGy1bKvaKhYNuYURN8qVohr1NJcnhRj
Team Info
Proposer Github: If you have Github profiles that are relevant to this proposal, list them here.
Yash Bharti: YashBit (yash_b) Β· GitHub
Proposer Experience: If you have relevant experience building zkApps or other dApps, provide that information here. If available, include links.
- PSE - Ethereum Foundation Grantee
- Internet Computer Grantee
- Distributed Systems, Web Dev, ZK
- Rust, C++, Python, Next JS
Team Members:
- Krishanu Dhar: ronykris (krish) Β· GitHub
- Rute Figueiredo: rutefig (Rute Figueiredo) Β· GitHub
Risks & Mitigations
-
Technical Complexity: Enhanced parsing of AccountUpdate objects may be more complex than anticipated.
Mitigation: Begin with thorough analysis of existing code. Prioritize core functionalities and prototype early.
-
Performance Issues: Increased detail in visualization may cause performance bottlenecks.
Mitigation: Implement progressive rendering and lazy loading. Conduct regular performance testing.
-
Compatibility with Future Mina Updates: Changes to Minaβs transaction structure could break the visualizer.
Mitigation: Design a modular core engine. Maintain communication with Mina core team. Implement extensive unit testing.
-
Scope Creep: Risk of exceeding the 1.5-month timeline due to feature expansion.
Mitigation: Clearly define and prioritize features upfront. Use agile methodologies. Be prepared to adjust scope to meet timeline.
By anticipating these risks and implementing mitigations, we aim to ensure smooth development and delivery of the Enhanced Mina Transaction Visualizer within the proposed timeline and budget.