Image for post
Image for post

While it’s currently possible to emit events from Neo smart contracts, we found that it’s not easy for applications to listen for these events, as all the current solutions require running your own infrastructure.

Because of this, we took it upon ourselves to build a system, open to everyone, that can deliver push notifications on smart contracts events, new blocks being finalised and transactions being broadcasted into the network and entering the mempool.

In this post I will go through the journey of building such a system, detailing the problems we ran into and how we solved them, but if you want to just give the system a go or see it in action, you could visit this page, which displays notification feeds in real time, check the source code on Github or just open a websocket connection to the following…


Image for post
Image for post

Binance Chain, like any other decentralized exchange, faces the eternal problem that has been plaguing DEXs for ages: Exchanges thrive on allowing users to trade a wide variety of tokens/coins, but how can a DEX list tokens from other chains while remaining decentralized?

So far the possible solutions that have been proposed are the following:

  • Custodian Model: Using wrapped tokens maintained by a custodian
  • Atomic swaps

Custodian Model

A custodian (in this case, Binance) creates a new native token in Binance Chain and sets up a system that lets anyone exchange this new native token for the real one it represents.

In the case of BTC, this means minting a new token called BTC.B and allowing users to exchange their BTCs for it through Binance’s centralised exchange. …


Image for post
Image for post

With the introduction of BEP3, now it’s possible to use atomic swaps to trade tokens native to Binance Chain for tokens native to other chains in a totally trustless way.

How do atomic swaps work?

Atomic swaps work through a multi-stage mechanism that makes sure that either the whole trade is completed or no part of it is, making it so it’s impossible for one side to cheat by obtaining some funds without having honored their part of the trade. We’ll illustrate how these work using an example: Alice, who owns 1 BTC, will trade it with Bob for 1 BNB through an atomic swap:

  1. Alice locks her BTC into a smart contract that says “If Alice reveals her secret before X minutes, send this bitcoin to Bob, otherwise send it back to her”. …

About

Albert Acebrón

I publish articles so that other people don’t have to waste their time on the things I have wasted my time.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store