Where does the Bitcoin address come from?
Can you explain that? Or are you saying somehow a Bitcoin wallet is built into Bitshares X?
No there is no bitcoin wallet integrated .. not exactly .. you cannot interact with the btc blockchain from within the btsx wallet.
However .. as both use the same elliptic curve crypto the private keys that generate you btsx account public key can also be used to derive a bitcion public key and from thus the bitcoin address ...
imagine: every 256 bit sequence can be interpreted as private key .. from there you can go to btsx .. or to btc .. or to both ..
if you were to send btc to the address in the btsx wallte you would need to export the corresponding private key .. import it into electrum or what every and can go on from there ... no magic .. just 256 arbitrary bits
I know some of us imported Bitcoin addresses but not everyone.
you can go the otherway too and import your btsx keys into bitcoin
Most people would already have BTC addresses set up externally so this feature is really only useful when validating that the output is sent to a valid btc address and the time when users just create a btc address to send to and then import their priv key into the btc wallet to retrieve the coins.. pretty useless IMO.
I wonder if we integrate into vennd api what it involves.. would it be useful to do such a thing? Are people using it? If it has volume then maybe its a good idea.. or we can brand it as another btsx product and do it from scratch if its not too hard.
This can be done in a trustless way, I will show an example using the web wallet:
1) Set up bitcore(http://bitcore.io)
2) When sending BTC, you send to your btsx address.
3) Import bitBTC into btsx web wallet via an import command which monitors the bitcore wallet balance for change, and updates bitBTC balance accordingly.
4) Sending bitBTC back to a BTC address would invoke bitcore to send the coins to another address, and re-update bitBTC balance based on the transaction in bitcore.
Because each node in btsx would have ability to connect to their own bit core wallet it is decentralized and trustless. You would keep your private key private and have ability to send BTC right to your btsx address and back to your BTC address seamlessly. Bitcore is able to get balance information of arbritrary bitcoin addresses without doing any private key imports, which is something the RPC can't do.
I think counterparty and thus vend might be already using this mechanism but in a central manor? They host bit core for you? I see that bitcore is used in counterparty but not sure if vennd is using it for the vending machine. http://bitcore.io/blog/ has a blog about counterparty using bit core.
Since its code compatible with the btsx web wallet you can do something like:
var bitcore = require('bitcore');
var Address = bitcore.Address;
var addr = new Address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa");
console.log(addr.isValid());
right in btsx and interact with bitcoin. Doing a TX is done in the same way with a bit more code. It needs to run against a trusted node, so that can be a local node or external (not sure if you can simply point to some DNS seed like the normal nodes do)
Wow .. I just now realize what you are saying .. building all of this as a web_wallet plugin... sounds nice ..
you still need someone to run a service that takes BTC and gives away bitBTC ... (or the otherway round) by parsing the blockchain
Well you wouldn't need to parse the blockchain as thats the point of using bitcore... a decentralized version of blockchain.info api. But yea you still need a way to give you bitBTC and taking BTC from you... and vice versa..This would be important because as the traded value of bitBTC fluctuates people will want to arb the value and transfer back to BTC... or arb BTC and transfer back to bitBTC, so it has to support high volume and be decentralized.
The service should be using the bitBTC/BTC exchange rate to do the conversion.. im just unclear as to how we can essentially "lock" the BTC so that they can't transfer to bitBTC and then double spend by importing their key into the bitcoin blockchain aswell. How does bitUSD/USD solve this issue?