CARV
CARVPlayPortalProtocol
  • Overview
    • Introducing CARV
  • SVM - AI AGENTIC CHAIN
    • Introduction
      • Architecture
      • AI Agent in TEE environment
      • CARV Verifier Nodes
    • Quick Start
      • Bridge Token
      • Explorer
      • Command line tool
      • Reading from CARV SVM Network
      • Writing to the Network
      • Network Info
  • D.A.T.A. - AI FRAMEWORK
    • Introduction
      • DeepSeek Integration
      • D.A.T.A's Core Features
      • How It Empowers AI Agents
      • Driving the Future of AI and Blockchain
      • Leveraging CARV SVM Chain for Privacy and Trustless Data Sharing
    • Quick Start Guide
    • Architecture
    • ERC-7231 (CARV ID)
    • Examples
      • On-Chain Insights
    • Getting Started
      • D.A.T.A Framework Plugin for Eliza
    • Use Cases and Implementation
      • Getting On-Chain Data for AI Agents
      • What's Coming with the D.A.T.A Framework
    • API Documentation
      • News
      • On-chain Data SQL Query
        • Ethereum Schema
        • Bitcoin Schema
        • Base Schema
        • Solana Schema
      • On-chain Data SQL Query by LLM
      • Token Info and Price
      • User Balance by Twitter ID
      • User Balance by Discord ID
  • CARV Ecosystem
    • CARV Play
      • Portal Access
      • Integration Guide
        • .Play Name Service Integration
        • API-Verified Quest (RESTFUL)
        • API-Verified Quest (GraphQL)
        • CARV ID OAuth 2.0
        • CARV ID Telegram SDK
      • Smart Contracts & Security
    • MOFF Bot & Customer Data Platform
    • CARV Account
      • ERC 7231
    • Verifier Nodes
      • How to Purchase Nodes
      • Buyback Program
      • Why Verifier Nodes
      • How do Verifier Nodes Work
        • CARV/veCARV Token
        • CARV Vault
        • CARV NFT License
        • CARV Protocol Service
        • Trusted Execution Environment (TEE)
        • Verifier Node
        • Attestation
        • Delegation
        • Rewards
        • SGX Attestation Verification
      • Verifier Node Sale Dynamics
      • Smart Contract Addresses
      • License Key (NFT)
      • Delegation
      • Node Rewards
      • Join Mainnet Verifier Nodes
        • Prerequisites
        • Delegation Tutorial
        • Operating a Verifier Node
          • Running in VPS
          • Running in CLI
            • Using Source Code
            • Using Docker
            • Gasless Server API
          • Running in Desktop App
      • Explorer
      • FAQ
        • Node Sale
        • Node Operation
  • CARV LABS
    • Introduction
    • Working with CARV Labs
  • Tokenomics
    • Utility
      • veCARV(s)
    • Distribution & Vesting
  • DECENTRALIZED GOVERNANCE
    • ⚔️Universal Guardian Program
    • 📔DAO Governance
    • 🌏Community Programs & Activities
  • Resources
    • 🗜️Writings
    • 🗞️CARV in the News
    • 🫶Social & Community Links
    • 🅰️Brand Guideline
    • 💰Job Openings
Powered by GitBook
On this page
  • Message Construction
  • POST ExplorerSendTxNodeEnter
  • POST ExplorerSendTxNodeExit
  • POST ExplorerSendTxModifyCommissionRate
  • POST ExplorerSendTxSetRewardClaimer
  • POST ExplorerSendTxNodeReportVerification
  1. CARV Ecosystem
  2. Verifier Nodes
  3. Join Mainnet Verifier Nodes
  4. Operating a Verifier Node
  5. Running in CLI

Gasless Server API

PreviousUsing DockerNextRunning in Desktop App

Last updated 7 months ago

To minimize node operating costs, CARV offers official endpoints that assist node operators in batching operations and posting them on-chain. While gasless transactions still necessitate user signatures for specific operations, CARV ensures endpoint availability. However, if you are concerned about risks, you also have the option to independently send transactions to the smart contract.

Base URLs: https://interface.carv.io

Message Construction

To make sure the gasless server still guarantee the authorization from the original node operater, it adopts the standard to proof authorization through the signature.

For more details of message structure:

Example config:

POST ExplorerSendTxNodeEnter

POST /explorer/send_tx_node_enter

Message structure (Golang)

typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeEnterData": {
				{
					Name: "replacedNode",
					Type: "address",
				},
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeEnterData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"replacedNode": replacedNode.String(),
			"expiredAt":    expiredAt,
		},
	}

Body Parameters

{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "replaced_node": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}

Params

Name
Location
Type
Required
Description

Origin

header

string

yes

User-Agent

header

string

yes

x-app-id

header

string

yes

» signer

body

string

yes

» replaced_node

body

string

yes

The node to replace. There are 2000 active node limit. To join the active set you have to specify a node has lower delegation than you to replace with.

» expired_at

body

integer

yes

» v

body

integer

yes

» r

body

string

yes

» s

body

string

yes

Response Examples

200 Response

{
  "code": 0,
  "msg": "string",
  "data": {}
}

Responses

HTTP Status Code
Meaning
Description
Data schema

200

Success

Inline

400

ResponseForFail

Inline

Responses Data Schema

HTTP Status Code 200

Name
Type
Required

» code

integer

true

» msg

string

true

» data

object

true

HTTP Status Code 400

Name
Type
Required

» error

string

true

POST ExplorerSendTxNodeExit

POST /explorer/send_tx_node_exit

Message structure (Golang)

apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeExitData": {
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeExitData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"expiredAt": expiredAt,
		},
	}

	v, r, s, err := tools.SignTypedDataAndSplit(typedData, c.verifierPrivKey)
	if err != nil {
		return
	}

}

Body Parameters

{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}

Params

Name
Location
Type
Required

Origin

header

string

yes

User-Agent

header

string

yes

x-app-id

header

string

yes

» signer

body

string

yes

» expired_at

body

integer

yes

» v

body

integer

yes

» r

body

string

yes

» s

body

string

yes

» version

body

string

yes

Response Examples

200 Response

{
  "code": 0,
  "msg": "string",
  "data": {}
}

Responses

HTTP Status Code
Meaning
Description
Data schema

200

Success

Inline

400

ResponseForFail

Inline

Responses Data Schema

HTTP Status Code 200

Name
Type
Required

» code

integer

true

» msg

string

true

» data

object

true

HTTP Status Code 400

Name
Type
Required

» error

string

true

POST ExplorerSendTxModifyCommissionRate

POST /explorer/send_tx_modify_commission_rate

Message structure (Golang)

typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeModifyCommissionRateData": {
				{
					Name: "commissionRate",
					Type: "uint32",
				},
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeModifyCommissionRateData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"commissionRate": strconv.Itoa(int(commissionRate)),
			"expiredAt":      expiredAt,
		},
	}

Body Parameters

{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "commission_rate": 100,
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}

Params

Name
Location
Type
Required

Origin

header

string

yes

User-Agent

header

string

yes

x-app-id

header

string

yes

» signer

body

string

yes

» commission_rate

body

integer

yes

» expired_at

body

integer

yes

» v

body

integer

yes

» r

body

string

yes

» s

body

string

yes

Response Examples

200 Response

{
  "code": 0,
  "msg": "string",
  "data": {}
}

Responses

HTTP Status Code
Meaning
Description
Data schema

200

Success

Inline

400

ResponseForFail

Inline

Responses Data Schema

HTTP Status Code 200

Name
Type
Required

» code

integer

true

» msg

string

true

» data

object

true

HTTP Status Code 400

Name
Type
Required

» error

string

true

POST ExplorerSendTxSetRewardClaimer

POST /explorer/send_tx_set_reward_claimer

Message structure (Golang)

typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeSetRewardClaimerData": {
				{
					Name: "claimer",
					Type: "address",
				},
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeSetRewardClaimerData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"claimer":   rewardClaimer.String(),
			"expiredAt": expiredAt,
		},
	}

Body Parameters

{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "claimer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}

Params

Name
Location
Type
Required

Origin

header

string

yes

User-Agent

header

string

yes

x-app-id

header

string

yes

body

body

object

no

» signer

body

string

yes

» claimer

body

string

yes

» expired_at

body

integer

yes

» v

body

integer

yes

» r

body

string

yes

» s

body

string

yes

Response Examples

200 Response

{
  "code": 0,
  "msg": "string",
  "data": {}
}

Responses

HTTP Status Code
Meaning
Description
Data schema

200

Success

Inline

400

ResponseForFail

Inline

Responses Data Schema

HTTP Status Code 200

Name
Type
Required

» code

integer

true

» msg

string

true

» data

object

true

HTTP Status Code 400

Name
Type
Required

» error

string

true

POST ExplorerSendTxNodeReportVerification

POST /explorer/send_tx_node_report_verification

Message structure (Golang)

typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"VerificationData": {
				{
					Name: "attestationID",
					Type: "bytes32",
				},
				{
					Name: "result",
					Type: "uint8",
				},
				{
					Name: "index",
					Type: "uint32",
				},
			},
		},
		PrimaryType: "VerificationData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"attestationID": attestationId[:],
			"result":        strconv.Itoa(int(result)),
			"index":         strconv.Itoa(int(index)),
		},
	}

Body Parameters

{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "attestation_id": "0x518c1c43067238438f81546f39623c49b09a8eeeb0ee14794aafefd9fa84c7ab",
  "result": 0,
  "index": 1,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}

Params

Name
Location
Type
Required

Origin

header

string

yes

User-Agent

header

string

yes

x-app-id

header

string

yes

» signer

body

string

yes

» attestation_id

body

string

yes

» result

body

integer

yes

» index

body

integer

yes

» v

body

integer

yes

» r

body

string

yes

» s

body

string

yes

Response Examples

200 Response

{
  "code": 0,
  "msg": "string",
  "data": null
}

Responses

HTTP Status Code
Meaning
Description
Data schema

200

Success

Inline

400

ResponseForFail

Inline

Responses Data Schema

HTTP Status Code 200

Name
Type
Required

» code

integer

true

» msg

string

true

» data

null

true

HTTP Status Code 400

Name
Type
Required

» error

string

true

EIP-712
https://github.com/carv-protocol/verifier/blob/main/internal/worker/signature_server.go
Example Config
OK
Bad Request
OK
Bad Request
OK
Bad Request
OK
Bad Request
OK
Bad Request