⚫
X-Gon
  • Platform
    • X-Gon
    • Overview
    • Social Media
    • Roadmap
    • X-Gon Beta on X1 Testnet
    • X-Gon on OKT Chain (OKTC)
  • Protocol
    • xrc-20
Powered by GitBook
On this page
  • Overview
  • What is Calldata?
  • Quick Start
  • How to send transactions for Xrc-20
  • How to track xrc-20 tokens
  • Standard
  • FAQ (Frequently Asked Questions)
  1. Protocol

xrc-20

xrc-20 is a new way of creating and sharing digital artifacts on X1 using transaction calldata.

PreviousX-Gon on OKT Chain (OKTC)

Last updated 1 year ago

Overview

xrc-20 is a protocol that allows users to share information and perform computations on and at a drastically lower cost.

xrc-20 achieves this by bypassing smart contract storage and execution and instead calculating state by applying deterministic protocol rules to "dumb" X1 calldata.

The goal of xrc-20 is to give users the ability to perform decentralized computations for a reasonable price.


What is Calldata?

xrc-20 tokens are cheaper because they store data on-chain using X1 transaction calldata, not smart contracts.

When you send someone $OKB via an X1 transaction or $OKT via on OKTC Chain, calldata is the "notes field." Sometimes people write things in the notes field, but typically when you send $OKB to a person you leave it blank.

When you interact with a smart contract, however, you add the information you're passing to the smart contract— the function name and parameters—to the calldata field.

xrc-20 is similar in that they encode data into calldata, but this information is not directed at smart contracts.


Quick Start

How to send transactions for Xrc-20

  1. Build JSON data according to the xrc-20 standard.

  2. Convert the json data to hex.

  3. Send any amount of OKB transactions to any address and use the hex data in the "Hex Data" field.

let op = {
 "p": "xrc-20",
 "op": "transfer",
 "tick": "xxxx",
 "amt": "100",
"to":"0x0000000000000000000000000000000000000001"
}
let data = web3.toHex(op)
ethereum.request({
     method: 'eth_sendTransaction',
     params: [{
       from: '0x0000000000000000000000000000000000000002',
       to:"0x0000000000000000000000000000000000000003",
       gasLimit: 21000,
       data: data,
       value: 0,
    }]
  })

How to track xrc-20 tokens

Standard

Deploy xrc-20

{
 "p": "xrc-20",
 "op": "deploy",
 "tick": "xxxx",
 "max": "21000000",
 "lim": "1000"
}

Key

Required?

Description

p

Yes

Protocol: Helps other systems identify and process xrc-20 events

op

Yes

Operation: Type of event (Deploy, Mint, Transfer)

tick

Yes

Ticker: 4 letter identifier of the xrc-20

max

Yes

Max supply: set max supply of the xrc-20

lim

No

Mint limit: If letting users mint to themselves, limit per ordinal

dec

No

Decimals: set decimal precision, default to 18


Mint xrc-20

{
 "p": "xrc-20",
 "op": "mint",
 "tick": "xxxx",
 "amt": "1000"
}

Key

Required?

Description

p

Yes

Protocol: Helps other systems identify and process xrc-20 events

op

Yes

Operation: Type of event (Deploy, Mint, Transfer)

tick

Yes

Ticker: 4 letter identifier of the xrc-20

amt

Yes

Amount to mint: States the amount of the xrc-20 to mint. Has to be less than

"lim" above if stated


Transfer xrc-20

{
 "p": "xrc-20",
 "op": "transfer",
 "tick": "xxxx",
 "amt": "100",
 "to":"0x0000000000000000000000000000000000000001"
}

Key

Required?

Description

p

Yes

Protocol: Helps other systems identify and process xrc-20 events

op

Yes

Operation: Type of event (Deploy, Mint, Transfer)

tick

Yes

Ticker: 4 letter identifier of the xrc-20

amt

Yes

Amount to transfer: States the amount of the xrc-20 to transfer.

to

Yes

Address to send to: States the receiving address.


FAQ (Frequently Asked Questions)

Is xrc-20 secure and trustless?

Absolutely! You can use the xrc-20 protocol without relying on external parties. While it might be convenient to trust an indexer, like most Ethereum community members do with Etherscan, you can always rebuild and verify the indexer data manually.

Is xrc-20 decentralized?

Yes, xrc-20 reinterpret existing Ethereum data, which is decentralized by nature. No one's permission is required to use xrc-20 and no one can ban you from using it.

You can use ! However if you don’t want to rely on me you can track things yourself as all the necessary data is publicly available and uncensorable.

X1 Network
OKTC Chain
x-gon.com