Zcashd and Orchard pool

There is a zcashd node and some funds in the wallet in the Orchard pool.
As far as I understand, the only method to transfer funds from the Orchard pool for zcashd is the RPC is: z_sendmany.
To make a transfer, you need to specify the “fromaddress”.
If you look at zcash-cli z_listunspent, there are entries without an address. These entries appeared as change when I transferred from UA to UA in Orchard.
They look like this (just example):

  {
    "txid": "dbca6bc0d33c9da91464...6b4696787d6fd53bb19f438465ad1275",
    "pool": "orchard",
    "outindex": 0,
    "confirmations": 65432,
    "spendable": true,
    "account": 0,
    "amount": 500.82116409,
    "memo": "f60000000...0000",
    "change": true
  },

That is, these funds are located at some “internal wallet address”.

Practical question: How can they be spent? By the z_sendmany operation or some other operation? What should be specified in fromaddress?

Theoretical questions:

What are these internal wallet addresses?

Returning to zcash-cli z_listunspent:
this method shows: an array of unspent shielded notes.
In my wallet, there are 37 such entries, including entries without an address (change), and all of them are in the Orchard pool.
But if you look at zcash-cli z_getnotescount, it shows that there are many more notes in the Orchard pool.
What is this discrepancy related to? Does one note not correspond to one unspent output?

This is not a question, just an observation: if you look at zcash-cli z_listreceivedbyaddress for ANY address obtained from z_listunspent, the output is the same: ALL operations in the wallet are shown.

I understand that we are already saying goodbye to zcashd. Nevertheless, besides it, there is no working wallet for full node today.

2 Likes

zcash-cli z_listaccounts | jq .[].addresses[].ua

Check this out for more help.

Most CEX’s use zcashd, so this statement is false.

Thank you for the response.
I checked that have only one account. Looked at the addresses I generated on it. What next?
For the unspent change, no address is shown in the command output z_listunspent. So how to spend it?
It seems, unfortunately, you did not understand what I am asking.

I wrote that besides zcashd, there are no full node wallets. What is the problem with this statement?

Are you asking how to spend funds, or how to spend funds in a very specific way? How were these funds recieved? What are the amounts? More information is need if you have a specific situation.

sendmany will work with the UA in your account in general.

Yes, I read it wrong. However by chance I’m still correct:

For your viewing pleasure, here is how to use zebrad

Do the following:

  1. Transfer 5 zec to the Orchard pool to address ua1

  2. Create address ua2 in the same wallet

  3. Transfer 2 ZEC from address ua1 to address ua2 within the Orchard pool

Question: On which address (note) are the 3 ZEC that became change from the operation in step 3 now located?
How can they be spent?

1 Like

Question: what are you trying to do? ( Why does this matter? )

Honestly, I don’t want to be negative. But if you don’t understand how the application, protocol, etc. work, and after the fifth time you still don’t get what the topic is about, please don’t write anything in the technical section

Any address corresponding to the unified account to which the change belongs will allow you to spend that change. When you provide a unified address as the source of funds for z_sendmany, zcashd selects arbitrarily from among the notes received by that account, including change notes. There is not actually address-level control over which shielded notes are spent; the address is just used to look up the account.

1 Like

Thanks a ton! Got it. You can specify any address in the account. Zcash will select the notes for the transaction by itself.
But is it correct that a note is essentially an unspent output?
If yes, then why can the list of unspent outputs (z_listunspent) in the Orchard pool not match the number of notes (z_getnotescount) . i used only orchard pool?

2 Likes

I was able to reproduce this; it looks like this is a bug in z_getnotescount and, surprisingly, nobody has ever reported this before. It looks like z_getnotescount is returning the total number of Orchard notes, including spent notes, whereas z_listunspent only includes unspent notes. As far as I can tell z_getnotescount is not very useful and so is pretty rarely used; this is likely why nobody had noticed (or at least, nobody had reported) the bug before.

I’ve created `z_getnotescount` returns results inconsistent with `z_listunspent` · Issue #7034 · zcash/zcash · GitHub to track this.

2 Likes