YKLABS – GO SDK for SingularityNET AI Marketplace

chevron-icon
RFP Proposals
Top
chevron-icon
project-presentation-img
Expert Rating 4.0
justmert
Project Owner

YKLABS – GO SDK for SingularityNET AI Marketplace

Expert Rating

4.0

Overview

We propose to develop a robust, production-ready Golang SDK that will serve as a crucial bridge between developers/consumers and the SingularityNET AI marketplace. This SDK will enable seamless integration with core platform components including Multi-Party Escrow (MPE), Registry smart contracts, and decentralized storage systems (IPFS/Filecoin), while maintaining full backward compatibility with the existing Python SDK.

RFP Guidelines

Golang SDK Development for SingularityNET AI Marketplace

Complete & Awarded
  • Type SingularityNET RFP
  • Total RFP Funding $60,000 USD
  • Proposals 5
  • Awarded Projects 1
author-img
SingularityNET
Oct. 15, 2024

The SDK will enable seamless integration with key components like Multi-Party Escrow (MPE), the Registry, and IPFS, serving both AI developers and consumers. It must maintain backward compatibility with the existing Python SDK, offer intuitive interfaces for managing identities, organizations, and services, and include strong security and scalability features. Comprehensive documentation is required to ensure ease of use and long-term maintainability.

 

Proposal Description

Company Name (if applicable)

YK LABS

Project details

The proposed Golang SDK will be architected as a comprehensive solution that bridges developers with the SingularityNET AI marketplace while maintaining strict backward compatibility with the existing Python SDK implementation. Here is the detailed technical architecture and implementation approach:

Core Architecture Components

1. Base SDK Layer

  • Core configuration management system utilizing Go's robust type system for configuration validation and management
  • Ethereum interaction layer leveraging go-ethereum for blockchain communication and transaction management
  • Identity management system incorporating secure key handling and address management
  • High-performance concurrent operation handling utilizing Go's native goroutines and channels
  • Comprehensive error handling framework with custom error types and recovery mechanisms
  • Structured logging system supporting multiple output formats and severity levels

2. Smart Contract Integration Layer

  • MPE (Multi-Party Escrow) Contract Interface:
    • Automated channel state management and synchronization
    • Cryptographic signature verification system for payment validation
    • Atomic deposit and withdrawal management
    • Channel lifecycle management including creation, updates, and closure
    • Balance tracking and monitoring systems
  • Registry Contract Interface:
    • Organization data management and verification
    • Service registration and metadata management
    • Tag-based service discovery system
    • Organization member management
  • Token Contract Interface:
    • AGIX token interaction management
    • Allowance and balance tracking
    • Transaction monitoring and confirmation system

3. Storage Layer

  • Distributed Storage Integration:
    • Direct IPFS node communication protocol
    • Content-addressed storage management
    • Filecoin integration for persistent storage
    • Content verification and validation system
  • Local Storage Management:
    • Efficient caching system for frequently accessed data
    • State synchronization between local and distributed storage
    • Cache invalidation and update mechanisms

4. Service Client Layer

  • Protocol Buffer Integration:
    • Automated gRPC client generation system
    • Service definition parsing and validation
    • Version compatibility management
  • Service Communication:
    • Multi-protocol support (gRPC, HTTP, Process-based)
    • Connection pooling and management
    • Load balancing with multiple strategies
    • Automatic retry mechanism with configurable policies
    • Circuit breaker implementation for fault tolerance

5. Payment Channel Management

  • Channel Lifecycle:
    • Automated channel state tracking
    • Balance monitoring and management
    • Expiration handling and renewal
  • Payment Strategies:
    • Free call implementation with token validation
    • Prepaid call system with balance tracking
    • Default payment strategy with real-time verification
    • Concurrent payment handling with atomic operations

 

Technical Implementation Approach

1. Architecture Implementation

  • Modular package structure following Go best practices
  • Clear separation of concerns between components
  • Interface-driven design for maximum flexibility
  • Dependency injection for component management
  • Version management system for API compatibility

2. Smart Contract Integration

  • Event monitoring and processing system
  • Transaction management with atomic operations
  • Gas estimation and optimization
  • Contract state synchronization
  • ABI management and version compatibility

3. Concurrent Operations

  • Channel-based communication between components
  • Goroutine lifecycle management
  • Context-based cancellation and timeout handling
  • Thread-safe state management
  • Resource pooling and management

4. Error Management

  • Hierarchical error type system
  • Contextual error handling
  • Recovery mechanisms for critical operations
  • Error reporting and logging integration
  • Debug information management

5. Service Integration

  • Dynamic service discovery
  • Protocol negotiation and selection
  • Service health monitoring
  • Automatic reconnection handling
  • Rate limiting implementation
 

Security Architecture

1. Key Management

  • Secure storage of private keys using OS-specific keychain when available
  • Memory security practices for sensitive data
  • Key rotation support
  • Multi-signature support for high-value operations

2. Transaction Security

  • Double-signing prevention
  • Transaction replay protection
  • Gas price management
  • Transaction confirmation monitoring

 

Backward Compatibility System

The SDK will maintain strict compatibility with the Python SDK's interface while providing idiomatic Go implementations:

1. Configuration Compatibility

  • Configuration format matching
  • Environment variable handling
  • Default values management

2. API Compatibility

  • Method signature matching
  • Error code compatibility
  • Return value consistency

3. Data Format Compatibility

  • Standardized data structure mapping
  • Protocol buffer version alignment
  • Metadata format consistency

 

Package Structure

snet/

├── config/ # Configuration management

│ ├── interfaces/ # Configuration interfaces

│ ├── validation/ # Configuration validation logic

│ └── providers/ # Different config providers (env, file, etc.)



├── identity/ # Identity and wallet management

│ ├── keys/ # Key management and storage

│ ├── wallet/ # Wallet implementations

│ └── signer/ # Transaction signing logic



├── blockchain/ # Blockchain interaction layer

│ ├── contracts/ # Smart contract interfaces and implementations

│ │ ├── mpe/ # Multi-Party Escrow contract

│ │ ├── registry/ # Registry contract

│ │ └── token/ # AGIX token contract

│ ├── types/ # Blockchain-specific types

│ └── transactions/ # Transaction management



├── storage/ # Storage management

│ ├── ipfs/ # IPFS integration

│ ├── filecoin/ # Filecoin integration

│ └── local/ # Local storage management



├── client/ # Service client implementation

│ ├── grpc/ # gRPC client generation and management

│ ├── http/ # HTTP client implementation

│ └── process/ # Process-based service support



├── payment/ # Payment channel management

│ ├── channel/ # Channel lifecycle management

│ ├── strategies/ # Payment strategies implementation

│ └── verification/ # Payment verification logic



├── metadata/ # Service and organization metadata

│ ├── models/ # Metadata models

│ └── validation/ # Metadata validation



├── logger/ # Logging framework

│ ├── formatters/ # Log formatters

│ └── outputs/ # Log output handlers



├── errors/ # Error definitions and handling

│ ├── types/ # Custom error types

│ └── handlers/ # Error handling logic



├── utils/ # Common utilities

│ ├── ethereum/ # Ethereum-specific utilities

│ ├── crypto/ # Cryptographic utilities

│ └── validation/ # Generic validation utilities



└── examples/ # SDK usage examples

├── basic/ # Basic usage examples

└── advanced/ # Advanced implementation examples
This structure enables:
  • Easy navigation and maintenance
  • Clear responsibility boundaries
  • Straightforward testing
  • Simple dependency management
  • Clean version management

Open Source Licensing

Apache License

The project will be fully open-source with Apache License 2.0

Links and references

The project development can be tracked in following link:

  • https://github.com/justmert/snet-go

Proposal Video

Not Avaliable Yet

Check back later during the Feedback & Selection period for the RFP that is proposal is applied to.

  • Total Milestones

    3

  • Total Budget

    $60,000 USD

  • Last Updated

    21 Nov 2024

Milestone 1 - Core Infrastructure & Smart Contract Integration

Description

This milestone establishes the core foundation of the SDK by implementing essential blockchain interactions and smart contract integrations. The focus is on developing a robust and secure base layer that handles contract interactions, transaction management, and identity systems. This phase will deliver the fundamental infrastructure needed for interacting with SingularityNET's smart contracts (MPE, Registry, AGIX) while ensuring secure and efficient blockchain operations.

Deliverables

• Base SDK layer implementation with configuration management • Complete MPE contract integration with channel management • Registry contract interface with organization/service handling • AGIX token contract integration with balance/allowance management • Blockchain interaction layer with transaction management/monitoring system • Identity and key management system with security features • Logging framework with structured output and severity levels • Event listeners and state synchronization system • Error handling framework with custom error types • Comprehensive test suite for core components • Initial technical documentation and architecture guide • CI/CD pipeline with automated testing • Developer quickstart guide

Budget

$25,000 USD

Milestone 2 - Service Client Layer & Payment Channel Management

Description

This milestone focuses on implementing the service client infrastructure and payment channel management system. It delivers the core functionality needed for interacting with AI services through multiple protocols while handling payment operations. The emphasis is on creating a reliable and efficient system for service communication and payment processing, including comprehensive error handling and rate limiting mechanisms.

Deliverables

• Complete service client layer with protocol support • Full gRPC implementation with protobuf support • Multi-protocol service support (gRPC, HTTP) • Payment channel management with all strategies (Free, Prepaid, Default) • Payment channel lifecycle management with balance monitoring • Error recovery, retry, and rate limiting mechanisms • Comprehensive integration test suite • Expanded technical documentation • Integration guides and examples

Budget

$20,000 USD

Milestone 3 - Storage Layer, Documentation, & Production

Description

This milestone completes the SDK by implementing the distributed storage layer and preparing the system for production use. It focuses on ensuring reliable content storage through IPFS/Filecoin integration, maintaining Python SDK compatibility, and providing comprehensive documentation. This phase includes thorough security reviews, performance optimizations, and extensive testing to ensure production readiness.

Deliverables

• Complete distributed storage layer with IPFS/Filecoin implementation for content verification and persistence storage • Local caching system for state synchronization • Security implementation review for key management and transactions. • Pyton SDK compatibility review for interface, data structure and metadata alignment • Complete API reference documentation with live ducumentation website • Comprehensive technical documentation with live documentation website • Integration examples covering all major use cases (10+) • Performance optimizations and benchmarks • Complete end-to-end testing suite with unit, integration and load testing • Maintenance guide with setup instructions in README.md • Release of the SDK with version 1.0.0

Budget

$15,000 USD

Join the Discussion (0)

Expert Ratings

Reviews & Ratings

Group Expert Rating (Final)

Overall

4.0

  • Feasibility 4.3
  • Desirabilty 4.3
  • Usefulness 4.0
  • Expert Review 1

    Overall

    4.0

    • Compliance with RFP requirements 5.0
    • Solution details and team expertise 4.0
    • Value for money 0.0

    The milestones are too large in content, it is not clear how much time they will be engaged in. The advantage is a good team with expertise.

  • Expert Review 2

    Overall

    4.0

    • Compliance with RFP requirements 3.0
    • Solution details and team expertise 4.0
    • Value for money 0.0
    There is relevant experience with SDKs, but in Python. Experience with GO is not specified. The milestone work is not aligned correctly, the first milestone may be blocked by the fact that the work from the third milestone has not been implemented.

    There is a description of the team, but no description of the GO experience, which is critical.

feedback_icon