Hermez Atomic Transactions Are Here!

2 months ago   •   3 min read

By Polygon Hermez

We’re glad to announce the release of a new feature on the Hermez node that will change the network’s performance as we know it today.

We’re releasing the Hermez node version 1.6, which will make the Hermez Network fully compatible with the Ethereum London hard fork.

Along with the upgrade compatibility, we’ll be implementing in the future several new features, like multitoken withdrawals, and the ability to choose the recipient address of a withdrawal.

The main benefit of this upgrade for the users is that they’ll save gas and time by withdrawing several tokens in one transaction. But the most revolutionary feature is atomic transactions.

In this article, you’ll find a detailed explanation of what atomic transactions are and what they mean for users of the Hermez Network. Let’s go and jump in!

Introducing Hermez Atomic Transactions

We all love the crazy world of DeFi, but for most users, high fees make those protocols and dApps prohibitive.

The latest release of the Hermez node will bring the most relevant DeFi application to our network: swaps.

And it will do so while preserving security, decentralisation and scalability that we already enjoy on the Hermez Network. All this at a fraction of the cost of an Ethereum Layer 1.

Atomic transactions will enable swaps, among other features. Atomic swaps have a particular property: they will only be forged if another transaction is also forged in the same batch. Let’s see it with an example:

Alice wants to trade 1 ETH for 2000 USDt. She asks Bob if he is interested. Bob agrees, and they exchange account details to generate and sign their transactions. In a human-readable format those transactions would be something like:
I will send 1 ETH to Bob if he sends me 2000 USDt / Signed: Alice
I will send 2000 USDT to Alice if she sends me 1 ETH / Signed: Bob

Finally, those transactions are sent to the network and will be effective at the same time. So both Alice and Bob have a cryptographic guarantee, thanks to zero-knowledge technology, that they will send their funds only if they receive what they’re expecting in return.

Actually, only if they got exactly what they expected, to the nano-cent, as this data is signed and there is no concept of slippage, AMM or anything. Amounts are agreed between peers beforehand.

We're currently working on the swap interface, and should be available in the coming weeks.

Time-Limited Transactions Feature

Following the previous example, let’s assume that Bob is an evil person and wants to take advantage of Alice's suggestion of swapping a fixed amount of ETH for USDt.

Not only that, but he is also collaborating with the next coordinators in line waiting to forge transactions. Bob could take advantage of the situation by instructing coordinators not to forge the atomic transactions until the value of ETH/USDt plays in his favour.

To avoid this malicious behaviour, we have implemented time-limited transactions. We call them “time-limited” because they have a special property: they only can be forged before a specified time (more specifically, a batch number). Let’s extend the previous example:

Alice is aware that Bob is not trustable, and if he can, he will cheat because he is incentivized to do so. Therefore Alice will make her transaction like this (human readable interpretation).
I will send 1 ETH to Bob if he sends me 2000 USDT in the following 10 minutes / Signed: Alice

Apart from the above, more improvements have been introduced in the latest release. Stay tuned to our Github to never miss updates and find more details, you can ask our team on Telegram. You can also follow us on Twitter for future updates.

Are you interested in building DApps on top of Hermez Network? Maybe an alternative to Uniswap on L2?

Check out the Developer guide, Go SDK, JS SDK and Flutter SDK. You can talk about your ideas directly with our developer team on our Discord.

Spread the word