Skip to content

Instantly share code, notes, and snippets.

View arielgabizon's full-sized avatar

Ariel arielgabizon

View GitHub Profile
@arielgabizon
arielgabizon / gist:67ec4a85900f19af880d909cfaf72f7d
Created July 5, 2017 18:13
A semi private atomic trade between Zcash and Ethereum
H was reading about atomic cross-chain trading in the wiki link above and think that perhaps the Zcash circuit could be used to easily get semi-private Zcash-Eth atomic cross-chain trading.
As in the wiki above it would require the parties to communicate before and verify by themselves that certain things have appeared on the two chains. On the other hand, it doesn't require Eth chain to verify Zcash Proof of Work as I thought was needed. What the Eth client will need to do is verify a snark of the Zcash circuit (which was recently implemented for the C++ client as described in https://z.cash/blog/zcash-eth.html)
Semi-private means Alice will agree with Bob to exchange say 10 zec for 1 eth, and this 10 will only be know by both of them. Furthermore the address to which Bob's 10 zec note will be sent will be a z-addr known only by him and Alice.
So here's how it could work (simplified)
0.Alice will send Bob the Eth address Addr where she wants to receive her 1 eth
Recall a Zcash note consists of a value v, pu
I was reading about atomic cross-chain trading in the wiki https://en.bitcoin.it/wiki/Atomic_cross-chain_trading and think that perhaps the Zcash circuit could be used to easily get semi-private Zcash-Eth atomic cross-chain trading.
As in the wiki it would require the parties to communicate before and verify by themselves that certain things have appeared on the two chains. On the other hand, it doesn't require Eth chain to verify Zcash Proof of Work as I thought was needed. What the Eth client will need to do is verify a snark of the Zcash circuit (which was recently implemented for the C++ client as described in https://z.cash/blog/zcash-eth.html)
Semi-private means Alice will agree with Bob to exchange say 10 zec for 1 eth, and this 10 will only be known by both of them. Furthermore the address to which Bob's 10 zec note will be sent will be a z-addr known only by him and Alice.
So here's how it could work (simplified)
0.Alice will send Bob the Eth address Addr where she wants to receive her 1 eth
Recall
0xfcfAeEE62aeE12450028744Ed8c3b58782E78eeF

0x298ed1b025d79f153bde4b99f0e7261246d065d2c621e8243438d3522e20d3fa