WTF is xmail?

an-old-mail-source-of-inspiration

Introduction

Cy[bord] introduces the virtual-opcode (vop) 'xmail,' an exciting new feature enabling the virtual transfer of CBRC-20 tokens between accounts. This feature leverages the virtualization of metaprotocol states, allowing CBRC-20 tokens to be moved without the need to transfer an inscription/UTXO from the sender to the receiver(s), hereafter referred to as the target(s).

xmail Virtual Operation (vop) Convention

The xmail virtual operation (vop) is defined in the metaprotocol field and accompanied by relevant metadata specifying the transaction details.

Metaprotocol Field

  • Format: cbrc-20:xmail:<tick>
  • Purpose: To initiate a mail of CBRC-20 tokens.

Metadata Field

  • Format: CBOR

Example

A single transfer of BORD tokens using xmail:

Metaprotocol Field

cbrc-20:xmail:BORD

Metadata Field

{
  "targets": [
    {
      "addr": "bc1pxxx",
      "amt": "1000"
    }
  ]
}

JSON-Schema valid representation

{
  "$defs": {
    "PhysicalAddress": {
      "type": "string",
      "description": "A standard reliable Bitcoin address"
    },
    "CBRCTolerableNumericValue": {
      "type": "string",
      "comment": "A numerical value passed in the form of a string which may contain spaces at the beginning or end of the string."
    },
    "XMailSubject": {
      "type": "string",
      "comment": "An optional value presenting the subject of this xmail"
    },
    "XMailBody": {
      "type": "string",
      "comment": "An optional value for a longer arbitrary message"
    },
    "XMailTarget": {
      "type": "object",
      "properties": {
        "addr": {
          "$rel": "#/$defs/PhysicalAddress"
        },
        "amt": {
          "$rel": "#/$defs/CBRCTolerableValue"
        }
      },
      "additionalProperties": true,
      "comment": "The receiver target"
    }
  },
  "type": "object",
  "properties": {
    "subject": {
      "$ref": "#/$defs/XMailSubject"
    },
    "body": {
      "$ref": "#/$defs/XMailBody"
    },
    "targets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/XMailTarget"
      }
    }
  },
  "additionalProperties": true
}

Operation Logic

  • Virtual Mail: xmail enables the transfer of tokens virtually, without an on-chain Bitcoin transaction from the sender to the target(s).
  • Balance Requirement: To execute an xmail transfer, the tokens must not be locked in an existing "hard transfer" inscription.
  • Available Balance: Only the "available" amount of tokens in a wallet (i.e., not locked by transfer inscriptions) can be sent through xmail.

xmail Virtual Operation (vop) Rules

Rule 1: Handling Invalid Address or Amount in xmail

  • If an xmail operation contains an invalid address or numerical value in amt, the affected object in the array is ignored, but the rest of the xmail operation proceeds normally.

Rule 2: Total Amount Exceeding Available Balance

  • If the total amt in the xmail array surpasses the sender's available balance, the entire xmail operation is deemed invalid.

Rule 3: Processing Order of MetaOps and Vops

  • Metaops such as deploy, mint, and transfer are processed before vops like xmail by the indexer (in each block).

Rule 4: Consumable versus Non-Consumable Operations

  • Consumable operations (deploy, mint, xmail) are active only during their first confirmation. Non-consumable operations (transfer) remain active after their first confirmation.

Rule 5: Sat Point Requirement for xmail

  • All xmail operations must target the default sat point [0:0].

Rule 6: Recipient Address and Funder Address Alignment

  • The funding address for the creation of an xmail inscription must match the recipient of the xmail inscription.

Rule 7: Execution of Validated xmail Operations

  • Upon passing verification, xmail operations proceed to execution, transferring CBRC-20 tokens as specified.

References

Last Updated:
Contributors: Danny Plainview, Junkfoodpunkroot