Monday, October 21, 2019

Cross chain compatible wallet for BTC scaling (brainstorming)

When it comes to pure monetary function, bitcoin is king. In terms of transaction speed and fees, EOS wins hands down. I'm having an idea for a hybrid BTC/EOS wallet that runs on both blockchains and may be a better solution than either lightning network on bitcoin, or a bitcoin IOU token on EOS. It would work as follows:

  1. EOS uses the same version, checksum, and encoding scheme as the Bitcoin WIF addresses and should be compatible with existing libraries. Here is an example of a WIF private key: "5KHpJyHDxfajzE2jjKxcMdJq9dPaAs44iMDY4Q93KcW9tkpJ3PL". That particular key corresponds to EOS public key "EOS7Pby6fVU78GFEDahsGxVth3Pvu4x6KAzZCUVBnmeq83C6XvsHZ", but it also corresponds to bitcoin address "1FWYxLio6AEuxq7FFfnFu4uFWNRrdALTeP".

  2. The user maps that EOS public key as the active permission to an EOS account, and send funds to that bitcoin address on the BTC blockchain.

  3. The user imports that single private key into the hybrid wallet, which is built to work on both blockchains and gives access to the bitcoin wallet and the EOS account simultaneously.

  4. The hybrid wallet has an integrated DEX (it could be any DEX, it does not need to be proprietary, although it may) enabled by a smart contract that instantly swaps BTC to a relatively stable EOS based token (we'll call it BTC2) cross chain.

  5. When the user wants to spend their bitcoin on the EOS network, they specify the amount to be sent (staying within the actual amount in their bitcoin blockchain wallet), and the DEX prepares tokens of the same value to be sent for the transaction in exchange for the actual bitcoin.

  6. The user then signs the transaction with the private key and broadcasts it to both networks at the same time. The bitcoin is sent to the DEX and the BTC2 is sent to the recipient on the EOS chain.

  7. To prevent double spending by the user via RBF (replace by fee), the smart contract may have a small reserve of bitcoin specifically for the purpose of continously "outbidding" malicious RBF actors with higher fees of its own until the transaction is confirmed in order to keep the money. The smart contract may also be programmed not to serve that private key ever again if such an event is detected.

  8. The hybrid wallet would not even need to be used for this, it could simply be used to onboard bitcoin users to EOS. The bitcoin user imports their private key, and the wallet generates an EOS public key from it and spends a small amount from the bitcoin wallet to create a new EOS account for the user.


No comments:

Post a Comment