April 18, 2026

Capitalizations Index – B ∞/21M

Atomic-swap for smart-contracts – Share&Charge – Medium

Atomic-swap for smart-contracts – Share&Charge – Medium

In our previous post about sending Dai between chains we did not mention smart-contracts. We showed how to send Dai from an account on Kovan to the same account on Tobalaba. This does not work if your tokens sit in a multi-sig smart-contract or are held by a uPort identity.

Registering address pairs

In order to transfer a token from an address on Kovan to a different address on Tobalaba, the origin and destination addresses need to be paired. The challenge is to make such pairs safe for production use.

Identifying pairs

To avoid complex signing, registration and authentication mechanisms, we opted to require that both the origin and destination addresses be smart-contracts and both have to be created by the same account.

We are aware that this rules out wallets created from factories but that is a limitation of this first version. In the future, we might add an address registration contract which will enable a user to prove the control of a particular contract.

Posting a pair

An additional dedicated end-point has been added address-pair which must be called with a POST, to comply with Restful paradigms.

Here is an example of how to create an address pair with node.js:

var request = require("request");

var options =
,
form:

};

request(options, function (error, response, body) );

If you look at the transactions behind the hashes in the code (click on them to open etherscan), you will notice that both have been sent by the same address 0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef. This is what makes the oracle accept the smart-contracts as pairs.

Using address pairs

Once registered, an address pair will just work. It can be used in the same manner as with an account. Follow the steps in the Try Out section of the previous post.

Conclusion

We now have an easy to use atomic-swap facility that allows the sending of tokens from ethereum accounts and smart-contracts. If you want to contribute or review or simply are curious, head over to the git repo, it’s all open-source.

Please create an issue in bitbucket if you spot a bug or have an idea on how to make this better.

Published at Mon, 18 Mar 2019 07:00:36 +0000

Previous Article

Bitcoin’s Price and Network Activity: One is Outpacing the Other

Next Article

Bitcoin Won’t Be $3,000 Cheap Again, Crypto To Trend Higher In April

You might be interested in …

BTC-ECHO Studie: Wo steht das deutsche Blockchain-Ökosystem?

BTC-ECHO BTC-ECHO Studie: Wo steht das deutsche Blockchain-Ökosystem? Wie viele Blockchain-Start-ups gibt es in Deutschland? In welchen Städten und Regionen pulsiert die Krypto-Szene?   Source: BTC-ECHO Der Beitrag BTC-ECHO Studie: Wo steht das deutsche Blockchain-Ökosystem? […]

Re: 如果比特币真的分裂了只有“两”败俱伤,没有赢家

Re: 如果比特币真的分裂了只有“两”败俱伤,没有赢家

Re: 如果比特币真的分裂了只有“两”败俱伤,没有赢家 对于持币用户,虽然分裂后会得到两种币,但两币相加的价值应该比不上现在了,币分裂了,新入的用户对比特币的信心更定大减,因为有了第一次还有第二次第三次,那选用比特币当避险资产的风险就变大了。 矿机商支持了BU或任何一种对矿机商有利的版本,分裂出币X,CORE和CORE支持者被迫修改算法,变成另一种比特币的币Y,币X,和币Y,都会有各自的支持者。按现在1000刀算,就算价格55分,到时候各值500刀,那对矿机商来说以后每天产出币的价值就折半了,这么久了哪边也没有说服哪一边,谁能继承BTC这个名号呢,一边不服另一边,到最后也只能为了区别对方币而为自己加个区别符号. CORE变态的坚持,听不进任何意见,矿机商的自私短视,惧怕闪电网络分走属于矿机商转帐手续费,造成了现在比特币濒临分裂,最后受伤的是所有的币友,不会有另边成为赢家。 (Why?) Published at Mon, 20 Mar 2017 07:05:57 +0000 [wpr5_ebay kw=”bitcoin” num=”1″ ebcat=”” cid=”5338043562″ lang=”en-US” country=”0″ sort=”bestmatch”]Million-dollar #banknotes. Barockschloß Riegersburg. Exhibition open until November. #bitcoinBy Mike Gogulski on 2013-06-03 13:07:39