Z_sendmany - Privacy Policy

Two Part Question:

Part One:
When sending zec with zcash-cli z_sendmany using curl:

curl --user myusername --data-binary ‘{“jsonrpc”: “1.0”, “id”:“curltest”, “method”: “z_sendmany”, “params”: [“t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd”, [{“address”: “ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf”, “amount”: 5.0}]] }’ -H ‘content-type: text/plain;’

1 1.0 ‘AllowFullyTransparent’ ?? where is it placed? in the above curl

Where, what is the correct formatting for the different Privacy Policy Options using curl? examples?

Part Two:
Using : z_listunspent , z_viewtransaction, z_listreceivedbyaddress, I’m trying to find a method to view a received transaction’s privacypolicy? If I receive a transaction to my wallet which is transparent, reveals amounts or receiving address etc, How can I view the policy used?

@Autotunafish or any help / advice out there?


Check out the examples here.

The privacy policy is not actually contained in the transaction metadata. It’s just a function of the senders wallet. However, you can get a pretty good idea about it per the address you received the funds at. If it was received transparent, then the minimum policy would have been ‘AllowRevealedRecipients’

Ill find some better examples

(I don’t know if anybody has actually asked about the curl version of the command)

1 Like

Curl z_sendmany with Privacy Policy: Help
Have any of you been able to z_sendmany using curl with privacy policy in the correct format?
@pacu, @_garethtdavies, @ChileBob @BrunchTime

Any help welcome.

Maybe this helps someone, here’s what some parameter arrays will look like:

[] — An empty array
["000b4430a7a2ba60891b01b718747eaf9665cb93fbc0c619c99419b5b5cf3ad2"] — An array with data
["'$signedhex'"] — An array with a variable
[6, 9999999] — An array with two parameters
{} - An empty object
[''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout' } ]'', ''{ "'$recipient'": 0.298, "'$changeaddress'": 1.0}''] — An array with an array containing an object and a bare object
1 Like

The node that I run has the internal wallet disabled (because it was making it a little bit under performant) so I cant personally troubleshoot this. The 3 values don’t have associated field labels but theyll likely be double quoted(?) and contained within the same bracket as the first address(?), perhaps like this?
5.0}] 'val1, ‘val2’, “privpolicy”] }’ -

The 2 numeric values might need single quotes, because I guess they may not technically be strings.

1 Like

creds=$(echo -n "$rpcCreds" | base64)

authHeader="Basic $creds"

curl -v -X POST "http://localhost:18232" \
     -H "Authorization: $authHeader" \
     -H "Content-Type: application/json" \
     -d '{
           "jsonrpc": "1.0",
           "id": "curltest",
           "method": "z_sendmany",
           "params": [
                 "address": "'"{TO_ADDR}"'",
                 "amount": '"0.001"'

This is what I’d do, works for me


Ah ok no qoutes on the first two :heart:Solid Snake
and that little, leading comma


Monumental Thank you @BrunchTime !!!
Thanks, for the quick and awesome reply, written perfectly clear. Works like a charm.

Go Bruins


Hi! Joining a little late to the party.

You need to put your arguments as @brunchtime said, in the JSON string payload.

This is because CURL is communicating with your node through RPC calls, so you are calling your node as it if was any node out there.

You also need to verify how your node is configured to make sure you authenticate correctly using the rpcuser and rpcpassword that you’ve set for it.

TIP: the zcashd node is not great at selecting notes. So it’s always convenient to have a good stock of unspent notes at your disposal to avoid “duplicate nullifier” errors when sending many payments subsequently.