Swan Chain
  • BULDERS
    • Getting Started
    • DApp Developer
      • Deploying Your First Smart Contract with Remix
      • Interacting with Smart Contract on Swan Chain Using Go
    • App Developer
      • Building Docker Images and Deployment file with LDL
        • Lagrange Definition Language(LDL)
      • Deploying with Swan SDK
      • Store and Retrieve a File with Swan Storage
        • 1. Set up the python-MCS-SDK
        • 2.Create and Manage Buckets
        • 3.Upload Files and Folders
        • 4.Retrieve and Download Files
        • 5.Delete Files and Buckets
    • Node Operator
      • Swan Node Snapshots
    • Market Provider
      • Storage Market
      • AI/ML Orchestrator
        • Decentralized AI Marketplace
        • Connect to Orchestrator
      • Web3 ZK Computing Market
        • ZK Auction Engine
        • Sequencer
        • Contribute zk-UBI-task
          • How to Contribute
        • Example
      • Customized Market Provider
    • Computing Provider
      • Fog Computing Provider(FCP)
        • FCP Setup
        • Migrating FCP to Swan Mainnet
        • FCP Funding Operations Guide
        • FCP FAQ
      • Edge Computing Provider (ECP)
        • ECP Setup
        • ECP Funding Operations Guide
        • ECP FAQ
      • FAQ
    • Storage Provider
      • Storage Auction System
    • Developer Tools
      • Swan SDK
        • Python Swan SDK
          • Special Case: Create ssh login instance
          • SWAN Orchestrator SDK - Function and Parameter Reference
        • Go Swan SDK
          • A Sample Tutorial
      • Swan Console
        • Getting Started
        • Blockchain GPU Task Example
        • Custom Blockchain GPU Task Pools
      • Lagrange
      • Swan IPFS Storage
      • Nebula Block Cloud
      • Ecosystem Projects
    • Mission 3.0
      • Get Started
        • For Users
        • For Space Holders
  • NETWORK REFERENCE
    • Network Info
      • Set Up Your Wallet
      • Bridge Token
    • Contract Addresses
    • Fees
  • Core Concepts
    • Introduction to Swan Chain
    • Consensus Layer
    • Peer-to-peer (P2P) Network
    • Payment Channels
    • Service Discovery
    • Market Provider
      • Storage Market
      • AI Computing Marketplace
        • Orchestrator
        • Auction Engine
        • Bidding Task State Machine
      • ZK Proof Marketplace
        • ZK Task
        • ZK Pool
    • Storage Layer
    • Computing Layer
      • Computing Provider Protocol
      • Computing Provider Account
      • Layer3 Computing Protocol
      • Reputation System
      • Dynamic Pricing
    • CDN Layer
    • Tokenomics
      • UBI Allocation Curve
      • Computing Provider Income
      • Computing Provider Collateral
        • Collateral Requirement and Computing Unit
        • DePIN Oracle
      • Governance
        • Treasure DAO
    • Glossary
  • Swan Chain Campaign
    • Swan CP UBI
    • Swan Chain Mainnet
      • Network Information
      • Swan Token
      • Swan Chain Mission
        • Social Mission
        • Onchain Mission
        • Mission: Celestial Bloom
      • Swan Provider Campaign
        • Fog Computing Provider (FCP)
        • Edge Computing Provider (ECP)
        • Market Provider (MP)
      • GALXE Campaign
      • Free Tier and Special Credit Programs
    • Atom Accelerator Race
      • Before You Get Started
        • Set Up MetaMask
        • Claim SepoliaETH
        • Claim testSWAN
      • CP Acceleration Program
      • Builder Acceleration Program
      • On-chain Interaction Race
      • Community Engagement Challenge
      • FAQ
    • Swan Saturn Testnet
      • Before You Get Started
        • Set Up MetaMask
        • Claim Faucet Tokens
        • Bridge Tokens
      • Transaction Drive Program
      • Community and Educational Events
      • Partnership and Integration Program
      • KOL Program
      • Computing Provider Program
        • FAQ
      • Developer Grant Program
      • FAQ
    • Swan Jupiter Testnet
      • How to Participate
      • Before You Get Started
      • Network Early Adopter
      • FAQ
  • RESOURCE
    • Links
    • Brand Kit
Powered by GitBook
On this page
  • Step 1: Fill out Information:
  • Step 2: Submit your ZK-task to the UBI Task Pool
  • Step 3: Get the ZK-Task Proof
  1. BULDERS
  2. Market Provider
  3. Web3 ZK Computing Market
  4. Contribute zk-UBI-task

How to Contribute

PreviousContribute zk-UBI-taskNextExample

Last updated 9 months ago

To contribute your zk-tasks to the UBI Task Pool, please follow these steps. For each task, submit a separate application. If you have multiple tasks, kindly submit individual applications for each.

Step 1: Fill out Information:

Provide details below and create a new .

ZK-Task Information:

  • Describe your zk-task, including task details, completion requirements, and minimal resource prerequisites.

  • Resource Requirements:

    • RAM:

    • Storage:

    • vCPU numbers:

    • GPU:

  • Input Parameters:

    • Specify input parameters required for your zk-task.

  • Task Completion:

    • Clarify the method to complete your task (customized binary, or other).

  • Output:

    • Describe the zk proof generated as output.

  • Verification:

    • Explain how to verify your proof.

  • Additional Parameters:

    • Mention any other necessary parameters.

  • A complete example: Include the task sample, proof, verify result etc.

Note: Repeat these steps for each zk-task if multiple tasks are being submitted.

Example Application:

ZK-Task Information:

  • Description: Implementing a customized binary for secure data processing.

  • Resource Requirements:

    • RAM: 16GB

    • Storage: 200GB

    • vCPU numbers: 4

    • GPU: Nvidia GTX 1080

  • Input Parameters: JSON file with task specifications.

  • Task Completion: Utilize the provided binary for data processing.

  • Output: ZK proof generated after task completion.

  • Verification: Refer to the attached verification guide.

  • Additional Parameters: Any additional information, requirements, or dependencies.

  • A complete example: Include the task sample, proof, verify result etc.

Submission Guidelines:

  1. Fill out the information above.

  2. Label the issue with "zk-task" and any specific task identifiers.

We appreciate your contributions to elevate the UBI Task Pool with your innovative zk-tasks.

Step 2: Submit your ZK-task to the UBI Task Pool

You can submit your zk-task to the pool through the API.

  • Method: [POST] {ubi_hub_base_url}/v1/tasks

  • Request Parameters:

//Parameters examples:
{
  "name": "example_task",
  "type": 1,
  "zk_type": "fil-c2-512M",
  "input_param": "example_input_zsdt_url",
  "verify_param": "example_verify_url",
  "resource_id": 1
}
Parameter
Type
Description

name

string

Task name

type

int

Task type 0: CPU; 1: GPU

zk_type

string

ZK type (e.g., fil-c2-512M、fil-c2-32G)

input_param

string

Network storage address of the input parameter file for executing UBI-task, compressed in zsdt format (recommended to use MCS storage)

verify_param

string

Network storage address of the input parameter file for verifying UBI-task results (recommended to use MCS storage)

resource_id

int

Resource ID 1,2,3,4

  • Response:

// return the task_id
{
  "task_id": 1,
}

Request Demo

package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"github.com/swanchain/ubi-benchmark/utils"
	"net/http"
)

func main() {
	var task = Task{
		Name:        "example_task",
		Type:        1,
		ZkType:      "fil-c2-512M",
		InputParam:  "example_input_zsdt_url",
		VerifyParam: "example_verify_url",
		ResourceID:  GPU512,
	}

	jsonData, err := json.Marshal(task)
	if err != nil {
		log.Errorf("JSON encoding failed: %v", err)
		return
	}

	resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
	if err != nil {
		log.Fatal("POST request failed: %v", err)
		return
	}
	defer resp.Body.Close()

	if resp.StatusCode == http.StatusOK {
		fmt.Printf("Request successful, status code: %d \n", resp.StatusCode)
	} else {
		fmt.Printf("Request failed, status code: %d \n", resp.StatusCode)
	}
}

type Task struct {
	Name        string `json:"name"`
	Type        int    `json:"type"`
	ZkType      string `json:"zk_type"`
	InputParam  string `json:"input_param"`
	VerifyParam string `json:"verify_param"`
	ResourceID  int    `json:"resource_id"`
}

const (
	CPU512 = 1
	CPU32G = 2
	GPU512 = 3
	GPU32G = 4
)
resourceId
type
cpu
memory_gb
storage_gb

1

CPU512

5

3

30

2

CPU32G

8

275

50

3

GPU512

5

3

30

4

GPU32G

8

275

50

Step 3: Get the ZK-Task Proof

You can request your zk-task's result from the pool through the API.

  • Method: [GET] {ubi_hub_base_url}/v1/tasks/{taskId}

  • Request Parameters:

// Parameters Examples:
{
  "id": 1,
  "type": 1,
  "zk_type": "fil-c2-512M",
  "proof": "xxxxx"
}
Parameter
Type
Description

id

string

Task id

type

int

Task type

zk_type

string

ZK type

proof

string

Proof/result after the completion of the task

  • Response:

// return the task result.
{
  "proof": "xxxxx",
}

Thank you for your contribution, and we hope your zk-task brings added value to the Swan decentralized computing ecosystem!

Create a new . with this information.Once the issue is reviewed and approved, we will provide you with the "ubi_engine_base_url" for you to submit your zk-task.

Note: If the configurations mentioned above (GPU/CPU) do not meet your requirements, please leave your specific requirements in the .

GitHub Issue
GitHub Issue
GitHub issue