katzenpost / mixnet_uprising

repository for tracking open tasks
18 stars 1 forks source link

implement PoC Zcash submission mixnet transport #51

Closed david415 closed 5 years ago

david415 commented 6 years ago

this should be fairly easy: "submit Zcash transactions over the mixnet"

of course this entails one or more Providers running a "zcash" Kaetzchen service which receives a Zcash transaction binary blob and submits it to the blockchain. Each of these Providers must of course run a full Zcash client.

Perhaps it should use the client RPC API for submitting the tranactions?

https://github.com/arithmetric/zcashrpcclient

anyhow, the Zcash kaetzchen is here:

https://github.com/katzenpost/server/tree/add_zcash_service.0

Although right now it doesn't actually submit the transaction to the blockchain, I need to figure out how to do that.

str4d commented 6 years ago

The simplest way to submit a transaction to the network using zcashd is via the sendrawtransaction JSON-RPC method, which accepts hex-encoded serialized transactions. The library you linked to above looks like it makes this easier for Go apps, but all you should need is that one API.

str4d commented 6 years ago

Oh, and on the input side, you should accept a hex-encoded transaction as well (and then convert to/from what looks like your in-network Base64 representation).

david415 commented 6 years ago

hmm this doesn't look suitable:

https://godoc.org/github.com/arithmetric/zcashrpcclient#Client.SendRawTransaction

whereas I'd like to just pass it a hex string.. hmm. there must be an easier way. perhaps i could do http + JSON RPC more directly.

david415 commented 6 years ago

hmm i get a 500 status code while the zcashd debug log shows us no problem at all:

2018-04-06 22:00:42 Received a POST request for / from 127.0.0.1:50284 2018-04-06 22:00:42 ThreadRPCServer method=sendrawtransaction

so maybe i'm supposed to get a 500 ;-p ?

david415 commented 6 years ago

current status is that the server should read it's zcash client rpc parameters from the toml config file AND i am using net/http to submit the RPC commands directly instead of using zcashrpcclient library as mentioned above.

david415 commented 6 years ago

https://github.com/katzenpost/docs/blob/master/drafts/zcash_send.rst

david415 commented 6 years ago

i've added a dev branch to our "tools" repo where i'm working on a "zcash wallet proxy":

https://github.com/katzenpost/tools/tree/add_zcash_wallet_proxy.0

which is a client that uses the mailproxy api to send a kaetzchen "request" to the zcash send service on the mixnet.

david415 commented 6 years ago

currently i'm working on the tools repo in the add_zcash_wallet_proxy branch and client repo master branch.

david415 commented 6 years ago

the current status of this ticket is that i finally got around to writing a simple client that submits a transaction and then immediately exits: https://github.com/katzenpost/tools/tree/master/wallet_proxy which depends on: https://github.com/katzenpost/client

this client works and is tested but i still have some sort of interaction problem with zcashd... which i'm using @str4d 's txsend dev branch of zcashd:

i get these errors in my zcashd debug log:

runCommand error: system("/home/human/wallet_proxy '030000807082c403010ffe663fb...'") returned 512      

my zcash.conf looks like this:

testnet=1
addnode=testnet.z.cash
txsend="/home/human/wallet_proxy '%s'"

Note that except for this txsend feature of the zcash dev branch... everything else is working... the server side RPC zcash transaction submition service works fine as does the wallet_proxy client which run manually with the specified hex transaction blob as the first cli argument.

str4d commented 6 years ago

i get these errors in my zcashd debug log:

runCommand error: system("/home/human/wallet_proxy '030000807082c403010ffe663fb...'") returned 512

This is caused by the system C++ call returning a non-zero error code, which is system- and library-specific but should be the return code of wallet_proxy. Is there anything special about the wallet_proxy client (or Go binaries in general), regarding the environment it needs to be run in? The system call probably isn't setting environment variables and such, which might be causing wallet_proxy to return error code 512.

david415 commented 6 years ago

i don't think that's the problem since i tested it with a bash script as well.

str4d commented 6 years ago

Does the example "echo '%s' >> tx.log" work for you?

On Sun, 27 May 2018, 10:09 AM David Stainton, notifications@github.com wrote:

i don't think that's the problem since i tested it with a bash script as well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/katzenpost/mixnet_uprising/issues/51#issuecomment-392291183, or mute the thread https://github.com/notifications/unsubscribe-auth/AEwzBwWlP099tcgyCAKELoOi4fxflzIzks5t2dKzgaJpZM4TIOe_ .

david415 commented 5 years ago

ok i've tested my plugin a while back and it did work... so closing ticket