After consideration of many different designs to transition PDC from Omni to ERC20, we now have a plan that we think provides the best security and is still reasonably user friendly. Concerning security our main goals were to not use any public-facing centralized server/database and to be completely transparent. We’ve already started implementation of this plan but would appreciate feedback from you before we launch.
Proposed usage
- Use an ERC20 compatible Ethereum wallet (for example myetherwallet.com) to generate or import an existing ETH address
- Copy this ETH address into a small tool/app we provide, which gives you a burn address for the PDC
- Send your PDC to this burn address (using omniwallet.org or Omni Core)
- Wait until we have detected and processed your burn action (probably at a fixed hour, daily) after which you can send a claim transaction to the provided Ethereum contract address to receive your new tokens
Technical details
To derive a burn address from an ETH address, where in Bitcoin usually the RIPEMD-160 hash of the SHA256 of the public key would be taken, we now simply use the Ethereum address. You can even do this manually on this webpage at step 3 (remove the 0x prefix from your Eth address): TP's Go Bitcoin Tests
In Javascript it looks something like this:
var bitcore = require("bitcore-lib")
// Target ERC20 address
var eth_address_str = '0xb794f5ea0ba39494ce839613fffba74279579268'
var eth_address_buf = Buffer.from(eth_address_str.replace('0x', ''), 'hex')
// Burn address
var btc_address_adr = bitcore.Address.fromPublicKeyHash(eth_address_buf)
btc_address_adr.toString()
We will use (Python) software to monitor the Bitcoin blockchain for any OMNI-PDC transactions. It can derive the ETH address from the receiving address by simply decoding the Base58 and removing the checksum bytes.
We will deploy an Ethereum smart contract to issue the new ERC20-PDC tokens. This smart contract will contain the derived Ethereum addresses and the ERC20-PDC “credit” those addresses are allowed to claim. The contract allows us to add address/credit pairs using a special address, which we will do when we detect new OMNI-PDC transactions.
While it would’ve been simpler to instantly send the ERC20-PDC to the derived Ethereum address, we cannot distinguish between a regular OMNI-PDC transaction and a transaction to a burn address. By requiring users to claim the ERC20-PDC through interaction with the smart contract we are sure the OMNI-PDC have been effectively burned. If we didn’t do this, we’d risk creating more than the current 50 million tokens that would be issued to addresses that can never be spend. It would inaccurately inflate the total supply and thus the market cap of ERC20-PDC, which would reflect badly on this project.
Because of the contract the system can’t be gamed. If you’d want to claim ERC20-PDC while you actually sent the OMNI-PDC to a bitcoin address that you own, you’re faced with the challenge of treating the RIPEMD-160 of the SHA256 of your bitcoin pubkey as an Eth address and figuring out what private key matches that Eth address. In other words, you’d have to break ECDSA and brute-force 160 bits of entropy with Keccak-256 hashing algorithm. That would also allow you to rob from any ETH address.
To figure out the private key from a burn address, you’d have to break or brute-force RIPEMD-160, SHA256, and ECDSA. If you can do this, you can rob any Bitcoin address and much more.
Conclusion
All of the relevant data in this process will be permanently stored in either the Bitcoin blockchain or the Ethereum blockchain. This means everything can be monitored and checked by anyone at anytime, which is how we believe a (temporarily) trusted party should behave in this ecosystem. While no system is 100% secure, we think the odds are high we can do this without serious incidents on our side. We aim to provide easy to understand guides and timely support to participants to hopefully prevent any mistakes on their side.
As mentioned earlier, feedback and questions are welcome!