🟢
warp.green | Docs
  • Users
    • FAQ
    • Creating a New Wrapped CAT
    • Contact Us
  • Developers
    • Introduction
    • Contract Addresses
    • warp.green
      • EVM - Sending And Receiving Messages
      • Chia - Sending Messages
      • Chia - Receiving Messages
      • Collecting Signatures
    • ERC-20 Bridge
      • Wrapping ERC-20s
      • Unwrapping ERC-20s
      • MilliETH
    • CAT Bridge
      • Wrapping CATs
      • Unwrapping CATs
  • Validators
    • Wallets
    • Deployment
    • Attestations
    • Rekeying
Powered by GitBook
On this page
  1. Developers
  2. warp.green

Chia - Sending Messages

PreviousEVM - Sending And Receiving MessagesNextChia - Receiving Messages

Last updated 1 year ago

For Chia, sending messages is as simple as creating a coin. Specifically, the 'CREATE_COIN' condition should contain the following arguments:

  • puzzle_hash: see below

  • amount: at least the current per-message toll (1000000000 mojos)

  • memos: a list of values as defined below

    • destination_chain: 3-byte identifier of the chain the message will be relayed to

    • destination: identifier (i.e., address) of the contract that will receive the message

    • contents: all remaining memo values will be padded to 32 bytes and be used as contents

Resulting Coin

The resulting coin's id will be used as a nonce, as Chia consensus enforces unique coin ids. The puzzle hash of the said coin should be a09eb1ea8c6e83c0166801dabcf4a70d361cc7f6d89c4a46bcd400ac57719037, which corresponds to the following puzzle:

(mod (
 my_amount 
)
  (include condition_codes.clib)

  (list
    (list ASSERT_MY_AMOUNT my_amount)
    (list RESERVE_FEE my_amount)
  )
)

The puzzle above is responsible for sending the message toll to the block farmer - i.e., use the coin's value as a transaction fee.

Overview of the process required to send a message. A coin with the sender puzzle hash outputs a special CREATE_COIN condition that contains details about the message. The resulting coin can be spent in the same transaction, and uses the message toll as a transaction fee.