xCalligraph.

An automated tool for signing xCall transactions

Paul Rouge
3 min readSep 6, 2023

--

This article is a short explanation of ‘xCalligraph’, a tool for ICON’s xCall Protocol and developers using xCall. The xCalligraph repository can be found here.

An important step in crosschain communication / verification, is signing the transaction on the “destination chain”. Going crosschain is at least a two-step process.

xCalligraph solves the issue for developers having to, either manually find and sign the correct data on the destination chain and then sign xCall’s executeCall() function, or build their own solution for this issue. xCalligraph can run on any simple/cheap VPS server and handle 50% of the crosschain steps for you.

How to use xCalligraph

xCalligraph is designed with ease of use in mind. All you have to do is set up the .env file on a system with Docker and docker-compose installed and run the program with make run.

In the .env file you set:

# set to true to enable the chain, set to false to disable
BERLIN=true
SEPOLIA=true

BERLIN_WALLET_PASSWORD=password
SEPOLIA_PRIVATE_KEY=privatekey

# addresses (dApps) to monitor, comma separated, all chains. keep on one line.
BTP_ADDRESS_TO_TRACK=btp://0xaa36a7.eth2/0x5c4fA4b22256Ff15E5A1aa02517d07d17cF7A7bE,btp://0x7.icon/cx3723d8cb8d8ac7da29f692ce2abc8156423631be

BERLIN_XCALL_ADDRESS=cxf4958b242a264fc11d7d8d95f79035e35b21c1bb
BERLIN_BMC_ADDRESS=cxf1b0808f09138fffdb890772315aeabb37072a8a
SEPOLIA_BMC_ADDRESS=0xE602326106f5E1d436a3CCEB2A408759925f81ff
SEPOLIA_XCALL_ADDRESS=0x694C1f5Fb4b81e730428490a1cE3dE6e32428637

# if test mode is true make sure to set both test blockheigts to a valid int64
# test blockheights must be numbers without commas, dots, or underscores.
# So 1000000 is valid, 1_000_000 is not, nor is 1.000.000 etc.
BERLIN_TEST_BLOCKHEIGHT=1000000
SEPOLIA_TEST_BLOCKHEIGHT=4149075

As you can see, it’s really straightforward.

  • You specify the chains you want xCalligraph to be active on and provide the password or private key for the wallets (make sure that they have enough funds in it to actually sign the transactions.)
  • You register the BTP-addresses you want to automatically sign executeCall transactions for.

And that’s it. Run make run and the program will run in the background. Each signed transaction will belogged in ./logs/transactions.log

Testing

You can run xCalligraph in two testmodes. In both you will have to set the blocknumber you want to check for xCall messages in the .env file. One testmode will only log the transaction hash to the console, but will not send the transaction to the blockchain. And the other will also send the executeCall transaction to the blockchain, and log the transaction data to ./logs/transactions.log.

  • Testing without sending the transaction to the blockchain is done with make test
  • Testing with sending the transaction to the blockchain and logging the transaction to ./logs/transactions.log is done with make testwithsigning

Note that in testmode, the program will only run on one block! So that has to be the block with the xCall callMessage event in it.

Conclusion and Contribution

xCalligraph is a powerful tool that simplifies the process of signing xCall transactions and enhances cross-chain communication. By following the straightforward setup instructions provided in this article, you can quickly integrate xCalligraph into your development workflow.

But the journey doesn’t end here. The beauty of open-source projects like xCalligraph lies in their community-driven nature. If you find this tool valuable or have ideas to improve it, consider contributing to its development. The GitHub repository for xCalligraph is a hub for collaboration and innovation. Your insights, bug reports, feature requests, or even code contributions can make a real difference.

Join us on GitHub, be a part of the xCalligraph community, and let’s continue to streamline cross-chain transactions together. Together, we can make the world of blockchain development more accessible and efficient for everyone.

xCalligraph GitHub Repository

Thank you for exploring the potential of xCalligraph, and happy coding!

--

--