The Bitshares/Bitcoin Gateway is inspired by Dan/Bytemaster's comments in this thread
https://bitsharestalk.org/index.php?topic=11730.msg154450#msg154450 about how Bitshares is already a full decentralized exchange and how it should be easier to purchase and use BTS and BitAssets.
How does it work? In simplest terms, if you use/import the same private-key starting with a '5' into both Bitshares and Bitcoin wallets, then you can use the BTC Gateway to send Bitcoin in exchange for GATEBTC in your bitshares account, or GATEBTC for Bitcoin in your Bitcoin wallet. GATEBTC's value derives from the fact that it is one-for-one fully redeemable for Bitcoin.
(Note, If you want to experiment, please use Bitshares version 0.4.27 or greater since it fixes an important issue
https://github.com/BitShares/bitshares/issues/1143For example,
On the Bitshares' client, you'll probably want to create a new account. Export the private-key for an address from your Bitcoin client (I'll recommend blockchain.info at the moment for reasons explained later), or create one with
https://brainwallet.github.io/ etc. Then create a new Bitshares account from the private-key on the command line with,
> wallet_import_private_key 5JYR...WiWMt mynewaccount true
Ensure the private-key starts with a '5', (indicating uncompressed btc keys) and of course don't share the private-key! If you start with an existing Bitshares account then you'll need to update that account's active-key like this,
> wallet_account_update_active_key myaccount fundaccount 5JYR...WiWMt
Register the account name, and post it or the BTS address here and I'll send 0.01 GATEBTC (approx $3.20 USD) to test with.
To exchange the GATEBTC for Bitcoin, just send the GATEBTC to the 'gatewaybtc' account.
> wallet_transfer 0.01 GATEBTC mynewaccount gatewaybtc
If all goes well, you will see an unconfirmed Bitcoin tx appear in your Bitcoin wallet after about 20 seconds.
It is also possible to send Bitcoin to the Gateway and receive GATEBTC in your Bitshares account. To do this, send Bitcoin from the wallet to the Gateway's Bitcoin address which is 1saPpnK1QydmWA7Qq9wPGMooKtmvD3gnR. The Gateway will issue and transfer GATEBTC after one confirmation. An important detail, is that all transaction inputs must refer to the same bitcoin address generated from the private-key otherwise the Gateway will be unable to determine what corresponding Bitshares account to send back to. I've tested using blockchain.info 'Custom' send feature and have scripts for bitcoind - other client's will vary.
About the BTC Gateway,
The Gateway is running Bitcoin and Bitshares full nodes, and is backed by a Postgresql database. GATEBTC is issued/burnt whenever new Bitcoin enters or leaves the system. This makes GATEBTC a provable fund that can be verified by checking the blockchain balances for 1saPpnK1QydmWA7Qq9wPGMooKtmvD3gnR and the GATEBTC shares issue.
Note, For anyone posting to receive free GATEBTC and Bitcoin, I'll be up for another few hours, but will check the thread again in the morning. I've posted a similar thread at /r/bitshares.