[1IP-65] P2P Network: Grant Request for POC

P2P Network: Grant Request for POC

This proposal outlines the scope of work, timeline, and team responsibilities for delivering the 1inch P2P network POC, a decentralized and highly private API gateway aimed at supporting Web3 developers and enhancing the functionality of dApps.

Summary:

The idea for the P2P Network System was initially conceived by the 1inch Co-Founders and shared with Boosty Labs as a desired web3 experienced development partner. Boosty Labs has concurred to take on the responsibility of P2P Network idea processing, system designing, and, eventually, system development. Here are the salient points of the proposal:

  • The Network aims to deliver a secure and practical interface for accessing the 1inch API
  • The primary objective of the Network is to forge a highly secure communication channel between users and the 1inch API, ensuring optimal data integrity and privacy.
  • An extensive P2P Network Toolkit will consist of crucial development tools such as an intuitive SDK for dApp owners and readyto-use Sync Clients to enable secure and efficient establishment of communication channels with the P2P Network.
  • The initiative aspires to augment the 1inch ecosystem, promote broader adoption of decentralized networking solutions, and foster the advancement of decentralized applications and services.
  • By providing robust and quality solutions to user requests, the P2P network offers a significant competitive advantage over centralized solutions.

WhitePaper Results https://docs.google.com/document/d/1dGBo4zC1NslS2uEDg888PVfZJW4JacL_/edit?usp=sharing&ouid=117229986640986347118&rtpof=true&sd=true

Solution:

  • Build an eventdriven RPC-based network comprising users, dApp developers, relayers, and resolvers.

Goals:

  • Ensure user privacy by decentralizing 1inch API calls.
  • Improve scalability for dApp development.
  • Provide seamless access to 1inch APIs.

Motivation:

  • Address privacy, scalability, and ease of access to DeFi features by transitioning from centralized clientserver architecture to a decentralized P2P network.

1inch APIs:

  • Leverage existing 1inch API solutions to offer enhanced features through the decentralized network.

Scope of Work

The purpose of this Statement of Work (SoW) is to outline the objectives, deliverables, and milestones for the Proof of Concept (PoC) phase of the 1inch P2P Network project. This project aims to establish a decentralized, secure, and scalable P2P network that enables private and efficient communication between decentralized applications (dApps) and the web3 API providers. The PoC will lay the groundwork for further development and refinement, ultimately leading to the MVP stage.The primary objective of this PoC is to implement a functional network infrastructure, secure messaging between nodes, and a fully integrated SDK, all without the Dutch auction mechanism, which will be introduced during the MVP phase.

  • The POC project involves building and deploying the network in three main stages:

(POC) Stage 1. Implement initial network without validation groups

Objective:

  • Develop the basic P2P network architecture.
  • Implement Relayer and Resolveer nodes without the validation group mechanism.
  • Implement a Resolver node based on a simple functionality, e.g., getWalletBalance.

Task Decomposition:

  1. Project Planning and Requirements Gathering
  • Define project goals, plan,s and deliverables.
  • Elicit and document requirements.
  • Allocate resources and assign tasks.
  1. Network Infrastructure Setup
  • Set up the basic P2P network infrastructure.
  1. Backend Development
  • Relayer Node Development:
    -Implement relayer functionality to forward user requests to resolver nodes.
  • Resolver Node Development:
    -Implement resolver functionality to process and respond to user requests.
    -Develop encryption and decryption mechanisms for secure data transmission.
  1. SDK development
  • Work with protocol requests to getWalletBalance API
  • Develop JS SDK
  • Work with protocol requests to getWalletBalance API
  1. Testing and Quality Assurance
  • Perform unit and integration testing on relayer and resolver nodes.
    -Ensure secure and reliable communication between nodes.
  1. Documentation and Training
  • Create comprehensive documentation for the network setup, and SDK usage.

(MVP) Stage 2. User-directed payment cap with Dutch auction.

  • Potential scope of the MVP after completing POC stage.
  • Timelines and budgeting for MVP can be provided after completion of POC.
  • The purpose of providing an MVP scope of work is to show which possible improvements and developments can be implemented after the POC stage.

The objective of the MVP:

  • Introduce a Dutch auction mechanism to determine the optimal price for executing requests
  • Introduce a rating system to improve user experience when selecting a target Resolver.

Task Decomposition:

Backend Development

  • Dutch Service Implementation:
  • Price inquiry initiation
  • User request submission
  • Dutch auction executions
  • Rating System Development:
  • Create a rating system based on resolver performance metrics.
  • Implement the rating system into the network.

Network Infrastructure Update

  • Integrate with Registration DAO Smart Contract on the Ethereum network.
  • Update network infrastructure to accommodate auction service.

SDK and API Integration

  • Integrate 1inch APIs into the network.
  • Develop SDK for dApp developers to utilize the P2P network.
  • Develop the SDK to support consensus and rating functionalities.

Testing and Quality Assurance

  • Perform extensive testing on the dutch auction mechanism and rating system.
  • Validate the performance and reliability of the auction.

Documentation and Training

  • Update documentation to reflect new features and functionalities.
  • Conduct training sessions on the consensus mechanism and rating system.

Milestones and Deliverables

The Proof of Concept will consist of such milestones:

Stage 1: Initial Network Implementation

S1. M1: Discovery Phase + Basic Flow Definition (Weeks 1–3)

Objective: Conduct a discovery phase to finalize the product’s technical and functional requirements, ensuring alignment between business needs and technical capabilities. Additionally, define a basic flow that outlines how the system will handle the request-response cycle.

Deliverables:

  • Requirements Documentation:
  • Finalize and document all key requirements for the PoC, including technical, functional, and performance aspects.
  • Define the minimal viable product (MVP) requirements for key components like relayers, resolvers, and SDK integration.
  • Basic Flow Definition:
  • Design the flow for a basic request-response cycle from dApp to relayer and resolver, without encryption. This flow should cover the success path using a mock API or simple method (getWalletBalance).
  • Ensure the basic flow is documented and includes initial assumptions and limitations for the PoC stage.

Acceptance Criteria:

  • A finalized and documented set of product requirements is agreed upon and approved.
  • Basic flow for the system (without encryption) is defined and documented.
  • A technical architecture diagram that clearly outlines the overall design of the system.

S1. M2: Full Flow, Including Encryption and Error Cases (Weeks 4–12)

Objective:
Implement the full flow with encryption and add error-handling mechanisms to ensure robust communication between relayers and resolvers.

Deliverables:

  • Encryption and Decryption:
  • Implement end-to-end encryption of messages between relayers and resolvers.
  • Error Handling:
  • Develop logic for handling unsuccessful cases such as node failures, invalid requests, and timeouts.

Acceptance Criteria:

  • Successful completion of the encrypted requestresponse cycle.
  • Error cases are correctly handled and documented.

S1. M3: 1inch API Support For resolver node (Weeks 13–15)

Objective:
Integrate the full 1inch API functionality (Get wallet balance) into the resolver, enabling real-world use cases.

Deliverables:

  • 1inch API Integration:
  • The resolver fully supports 1inch API methods, enabling developers to access key functionality such as swapping and querying prices.

Acceptance Criteria:

  • Resolver can execute API calls through the 1inch API and return correct data.

S1. M4: SDK Working with the 1inch API (Weeks 15–18)

Objective:
Provide a developer SDK that interacts with the 1inch API through the P2P network, ensuring ease of use for dApp developers.

Deliverables:

  • SDK Development:
  • Create a JavaScript SDK for dApp developers, with clear API calls that interface with the 1inch API through relayers and resolvers.

Acceptance Criteria:

  • SDK is functional, welldocumented, and tested with 1inch API examples.

Stage 2: Additional Features (for future MVP)

S2. M1: Dutch Auction

Objective:
Introduce the Dutch auction mechanism for request execution pricing.

Deliverables:

  • Auction System:
  • Implement a dynamic pricing mechanism where resolvers bid to execute requests based on user-defined maximum prices.

Acceptance Criteria:

  • Successful execution of requests by the lowest bidder through the auction process.

S2. M2: Rating System

Objective:
Introduce a rating system to evaluate resolver performance based on metrics such as uptime and response time.

Deliverables:

  • Rating System:
  • Implement a performance-based rating system that ranks resolvers based on key metrics (e.g., latency, uptime, success rate.

Acceptance Criteria:

  • Resolvers are ranked based on performance, and this information is used to prioritize which resolvers handle requests.

Deliverables Format:

  • All code and configuration files will be delivered via 1inch GitHub repo.
  • A detailed technical report outlining each milestone’s deliverables will be submitted.
  • Documentation will be continuously updated to reflect progress and changes.

Team Setup
The POC project requires the following team roles:

Senior Go Developer

Expertise:

  • Advanced knowledge of Go programming language.
  • Extensive experience in developing decentralized networks.
  • Proficient in designing and implementing secure communication protocols.
  • Strong understanding of backend development and infrastructure.
  • Experience with encryption and decryption mechanisms.
  • Familiarity with SDK development and API integration.

Responsibilities:

Network Infrastructure Setup:

  • Collaborate with DevOps to set up the basic P2P network infrastructure.
  • Ensure the architecture supports scalability and security requirements.
  • Relayer Node Development:
  • Design and implement the relayer functionality to forward user requests to resolver nodes.
  • Ensure efficient and reliable message forwarding mechanisms.

Resolver Node Development:

  • Develop the resolver functionality to process and respond to user requests.
  • Implement robust encryption and decryption mechanisms for secure data transmission.

SDK Development:

  • Lead the development of the Go and JS SDK to interact with the protocol and getWalletBalance API.
  • Ensure both SDK are user-friendly and well-documented.

Testing and Quality Assurance:

  • Oversee unit and integration testing for relayer and resolver nodes.
  • Ensure secure and reliable communication between nodes.
  • Collaborate with QA to identify and fix bugs and performance issues.

Documentation and Training:

  • Create comprehensive documentation for the network setup and SDK usage.
  • Provide training and guidance to the middle developer and QA team.

Timeline:
4,5 months

Middle Go Developer

Expertise:

  • Proficient in Go programming language.
  • Experience with backend development and P2P network concepts.
  • Knowledge of secure communication protocols.
  • Familiarity with SDK development and API integration.
  • Ability to work under the guidance of a senior developer.

Responsibilities:

Relayer Node Development:

  • Assist in implementing the relayer functionality.
  • Write code to forward user requests to resolver nodes.

Resolver Node Development:

  • Support the development of resolver functionality.
  • Implement parts of the encryption and decryption mechanisms under senior developer guidance.

SDK Development:

  • Contribute to the development of the Go SDK.
  • Implement protocol requests for the getWalletBalance API.

Testing and Quality Assurance:

  • Participate in unit and integration testing for relayer and resolver nodes.
  • Collaborate with the QA team to identify and fix bugs and performance issues.

Documentation and Training:

  • Assist in creating documentation for the network setup and SDK usage.
  • Participate in training sessions led by the senior developer.

Timeline:
4,5 months

Automation QA

Expertise:

  • Strong understanding of QA methodologies and testing processes.
  • Experience with automated testing tools and frameworks.
  • Knowledge of infrastructure testing and secure communication protocols.
  • Ability to write and execute comprehensive test plans and scripts.
  • Good communication and documentation skills.

Responsibilities:

Test Planning and Preparation:

  • Develop detailed test plans and strategies for relayer and resolver nodes.
  • Identify test scenarios and create test cases to cover all functionalities.

Automated Testing:

  • Implement automated test scripts to perform unit and integration testing.
  • Ensure tests cover secure and reliable communication between nodes.

Testing and Quality Assurance:

  • Execute test cases and scripts, reporting any bugs and performance issues.
  • Collaborate with developers to resolve issues and retest fixes.
  • Ensure the system meets all security and reliability requirements.

Documentation:

  • Document all test plans, test cases, and testing results.
  • Provide clear and concise bug reports and status updates.

Timeline:
1,5 month

Financial Plan Breakdown for POC
Project Duration: 4,5 months

Total Budget for POC: 141,000 USD (equivalent to 141,000 USDT/USDC)

Milestone Budget Breakdown:

S1. Milestone 1: 21 000 USD

S1. Milestone 2: 63 000 USD

S1. Milestone 3: 28 500 USD

S1. Milestone 4: 28 500 USD

Payment structure: We expect 50% of milestone cost upfront and 50% of milestone cost when the milestone is delivered and approved by 1inch team.

Payment Transaction Details:

  • Wallet address: 0xC39f5f17578f44EAceaf85BC00879aAFDa370E45
  • Blockchain Network: Ethereum Mainnet
  • Token: USDT or USDC
  • Token Standard: ERC20
  • Funds will be allocated to the 1inch DAO Operations Multisig (0x45e84e10e8E85c583C002A40007D10629EF80fAF), then transferred to Boosty Labs
  • Payment Transaction Flow (Required by Boosty Labs): To ensure a secure and accurate payment transaction, 1inch is requested to follow these steps:
  • First, 1inch should send a test transaction of 5 USDT/USDC.
  • After the test transaction is verified on the blockchain with the “Success” status, Boosty Labs’ Finance Department will review and confirm receipt of the test amount.
  • Upon receiving confirmation from Boosty Labs, 1inch is requested to proceed with the transfer of the remaining cost.

Boosty Labs expertise
About Boosty Labs:

  • Boosty Labs is the largest blockchain development shop in Europe. The team includes 150+ software engineers, QA engineers, DevOps, SDET, UI/UX designers, project and product managers. Boosty is an experienced team with a deep expertise in the blockchain and fintech industry. We have done a bunch of complicated projects including IDO launchpads, NFT drops, NFT marketplaces, P2E games, DEX, CEX, Dapps, NFT minting tools, decentralized messengers, decentralized VPNs, cross chain bridges and many other different projects.

Blockchain Stack Expertise:

  • Solidity (Ethereum, Polygon, Avalanche)

  • Rust (Solana, Casper, Polkadot Substrate)

  • Cosmos/Tendermint

  • FunC (TON)

  • Motoko (Dfinity)

  • Cadence (Flow)

  • Haskel (Cardano, Concordium)

  • C++ (EOS, WAX, TELOS, Proton)

  • Experience:
    Boosty Labs worked with leading companies in the blockchain and DeFi space, like Ledger, Celsius Network, Pocket Network, and Paraswap, handling a wide range of projects from decentralized VPNs, cross-chain bridges, to NFT marketplaces and tokenization platforms.

  • Additional details of some of the successful projects:

  • Ledger: Implemented an NFT Metadata Indexer Pipeline that:

  • Indexes logs for all ERC721 and ERC1155 tokens and collections, ensuring comprehensive data retrieval.

  • Downloads, caches, and parses metadata to facilitate accurate and efficient data management.

  • Indexes the parsed data on a search engine, optimizing data retrieval and management functionalities.

Coinspaid: Conducted a comprehensive audit that led to the following business and system improvements:

  • Enhanced system performance and security;
  • Streamlined business processes;
  • Identified new product features, ensuring the product maintained its competitive edge and alignment with evolving market demands.

Affinidi: Developed a tablet-only web application that:

  • Utilizes tablet cameras to scan QR codes on VCs, extracting the necessary information for verification.
  • Transmits the scanned data to the backend, which then forwards it to the respective verifying institutions.
  • Receives and displays verification results on the user interface, providing customs officials with clear and immediate feedback.
1 Like

Hey @Danylo, thank you for the proposal, the concept is well-aligned with 1inch’s mission to improve the robustness of the DeFi space. I have some comments from the core team on this proposal:

Milestones

Members of the DAO, myself included, have wanted to move away from giving the entire grant amount upfront and instead go with milestone-based payments.

Suggestion: Break down the 4.5-month timeline into 2-3 concrete milestones with clear deliverables and success criteria for each. Then the ops multisig can release the milestone payments as progress is made. An upfront payment can still be included.

Technical review

This proposal is highly technical, so it is critical that we have a committed reviewer onboard at the start of the grant. I believe we can leverage some of the core developers at 1inch for this role.

Appreciate your comments! Just updated the proposal and added milestones, please let us know if they look good

Deliverables Milestone 1:

Summary

We have set up the foundational infrastructure, including access to key services and tools required for the project. This includes:

• Grafana dashboards for monitoring logs and performance.
• Functional Relayer and Resolver endpoints.
• A fully operational Blockchain instance in Docker Compose.

Documentation https://docs.google.com/document/d/1_wjEw0ZGMRtZ-c7Iwdp5_67dCgwCXe2KvcyiStu0qdE/edit?tab=t.0#heading=h.82m6akl9es7f

Deliverables for Milestone 2 https://github.com/1inch/p2p-network/tree/poc_milestone_2
Also attaching a demo video which includes the Full Flow with Encryption and Error Cases https://drive.google.com/file/d/1mW46OjPVyO8Em03wcIbZkJ52Ii08cgHs/view?usp=sharing

Milestone 3 Deliverables

Demo https://drive.google.com/file/d/1cSjxLkIl9MjAQAaFiQir-s7UC-ymQ_qU/view?usp=sharing
Github Repo https://github.com/1inch/p2p-network/tree/poc_milestone_3

Instruction https://github.com/1inch/p2p-network/blob/poc_milestone_3/tools/webrtc-tester/README.md
Updated doc https://docs.google.com/document/d/1fKcyTY48ds-hv46Z-aj-vb_3iN5HJbpClZKIVkTVeN4/edit?usp=sharing

Milestone 4 Demo https://drive.google.com/file/d/1cqcKsc5z3m25gzcjiI12bBqIpE13cyz_/view?usp=sharing

Github repo https://github.com/1inch/p2p-network

Instruction https://github.com/1inch/p2p-network/blob/dev/sdk/README.md

SDK doc https://docs.google.com/document/d/1jjdcd2Hx9Kkd5_dpwgM-DWMo179KbjPQnS8BJV_yCoQ/edit?usp=sharing