It has been a very busy week for the Bytether developer team, we have done the internal testing for our smart contracts and deployed to live for reviewing.

1. Milestones

Before going to explain about our smart contracts, let go through some ahead milestones:

The verification website is out soon. After collecting all feedback from the community, we will finalize the smart contracts and open the webpage for all users to register and claim BTH. To prevent overload on Ethereum network, the bitcoin blockchain will be snapshot and you can claim BTH whenever you want from this website. The snapshot block number are still under discussion, please join our slack to give your opinions. Referral program will be introduced in this week. Announce which exchanges BTH will be listed.

2. “Very few of us are what we seem. “ (Agatha Christie)

Bytether is getting more and more attention from the Bitcoin community. People want to claim Bytether(BTH) with their BTC address and some even want to claim other people BTC address as well :).

How can we verify the real owner of the Bitcoin addresses and send BTH to the BTC owners?

Here is the story

Bob and Alice come to BTH customer service, named John, at the same time and tell John that they are the owner of the address 18z1YyC2VXfAWDmZYhvw9TXZwYT5zTUYPV . They want to claim 1.6 BTH as they have 1.6 Bitcoin at block #49xxxx.

Who should our John send BTH to? John knows that only the owner of the Bitcoin address has private key, so he asks them to sign message “bytether.com” with their private key. He can use bitcoin address to verify the signature later.

Alice: OK!, I have the private key, signing a message is easy to me :)

Bob: hmm, — silently walk away.

John then checks whether Alice has successfully signed the “bytether.com” text or not. Once John confirms the signature is valid, he immediately sends BTH to Alice.

3. Cross-Fork Smart contracts

Cross-fork is processed via two smart contracts. They are all deployed to Ethereum Mainnet with the verified source codes. However, as we are running the public review processing, protected flag is set for all smart contracts. Please do not try to interact with them for now (subscribe our channels to get the publish date).

The following are the introduction to our three smart contracts that may require readers to have some knowledge of solidity & Smart Contract to understand.

Bytether Token Smart Contract

The contract source code can be viewed at https://etherscan.io/address/0xfad572db566e5234ac9fc3d570c4edc0050eaa92#code

The token contract inherits all standard functions of ERC20 token. But, it has two extra important functions:

Trigger Cross Fork

Callback CrossFork

The “triggerCrossFork” function calls the BTHCrossFork contract (mention later) to check the bitcoin amount & ownership, BTHCrossFork contract calls back with the corresponding BTH amount user should receive. The refer code is also included in this call back.

To prevent any problems, we also prepare a tool to revert cross-fork:

2. Bytether Cross Fork Smart Contract

The contract source code can be viewed at https://etherscan.io/address/0x47358f526ee4f461e92a48abb23ece47540a2943#code

This smart contract uses Oraclize to call a HTTP API to get the balance of the bitcoin address. Currently, It is impossible to interact between Ethereum Blockchain & Bitcoin Blockchain in a decentralized way. Hence, we run a bitcoin node on our server and feed our smart contract with the balance and ownership information.

The API is at https://www.bytether.com/oraclize/get_bth_value. Although it sounds like a centralized model, the combination of the two smart contracts makes sure all transactions public and verifiable. Anyone can take a look the transaction data to figure any hacks or inconsistent.

* Bytether Cross Fork contract is designed to be updatable. Any bugs or problems in those contracts can be updated quickly without an expensive cost.

Please help us to review the smart contracts. If you find any problems please let us know at contact@bytether.com, BTH reward will be given for bug feedbacks. Thanks!