Fee divergence between Zebra and Zakura: Questions

Hi all, I’d like to check my understanding on some fee-related stuffs between Zebra and Zakura implementations.

From what I can see, both nodes aren’t using the same `MARGINAL_FEE` value which seems to open the door for privacy leakages in the ecosystem (i’m not working on node stuffs, so please let me know if I miss smthg obvious :slight_smile:)

From my understanding, getstandardfee (feat(rpc)!: add `getstandardfee` RPC returning the ZIP-317 marginal fee by aphelionz · Pull Request #10717 · ZcashFoundation/zebra · GitHub) allows wallets to get their fee from the node.
The thing is:

Fees are public, including on fully shielded transactions, right?
So, if a wallet takes its fee from getstandardfee, as Zebra’s PR#10717 intends, the fee it pays reveals whether its backend runs Zebra or Zakura. ZIP 317 already notes that non-standard fees can reveal users, wallets or wallet versions (ZIP 317: Proportional Transfer Fee Mechanism), and ZIP 2009 coordinates its switch height for the same reason (ZIP 2009: Reduce Marginal Fee to 1000 Zatoshis and Raise the Weight Ratio Cap to 10).

TL;DR: AFAICT, having nodes returning different values on getstandardfee can be used to break indistinguishability and thus run some sort of fingerprinting attacks (because the value of the fee can leak the node the wallet is talking to).

Do I miss something?

4 Likes

I think it also risks dropping txs during relay if a zebra node connects to a zakura node.

2 Likes

Full nodes don’t control the fee’s wallets use! They only control minimum fee to enter a given node’s mempool, and that value itself should be per-node configurable. One day if there is a consensus fee market, that may change. I hope we add a consensus fee market soon after (or in) Tachyon, where it can be well designed without privacy compromise for multisigs / HW wallet signers.

Wallets have their own fee, which indeed is ideally consistent for privacy needs. At minimum consistent for all of the wallets users, and ideally across wallets as well. Shielded Labs is currently encouraging wallets to query full nodes for “getStandardFee” as an intermediate step. Adding an indirection makes sense, why that belongs on the full node versus the pre-existing RPC interface for wallets (“Lightwalletd”) isn’t clear to me.

If wallets are depending on this coming from the full node, it should be separately hard-coded from the mempool’s admission policy. However a generic full node query for versioning this doesn’t actually make sense imo, since then the fee can only update at fixed height boundaries beyond the slowest nodes EOS height - way too slow for an ad-hoc fee market’s ability.

I’d advocate:

  • The natural thing to use is LWD, even for IP privacy reasons.
  • It is never a safe assumption to assume every LWD / full node returns the consistent result. A wallet can only aim to ensure all of their default providers update in tandem. At the point where a wallet is reasoning about that, it seems easier for it to manage on its own, unless they are aiming to serve users who do not update soon after release.
  • Zakura’s “getStandardFee” can be updated to match Zebra today, though this isn’t the right assumption wallets should use. (Wallets choose their standard independently of any full node work)
2 Likes

But in practice, zebrad will not even add a tx that pays lower than the zip 317 standard fee.

2 Likes

And if we remove this from the existing mechanisms, we remember what that could lead to.

Thanks @ValarDragon, that’s helpful - and yeah, makes sense. Wallets owning their fee, with LWD / Zaino as the natural indirection layer, sounds like the right model to me :slight_smile:

Zakura’s “getStandardFee” can be updated to match Zebra today, though this isn’t the right assumption wallets should use. (Wallets choose their standard independently of any full node work)

Yeah, I think matching Zebra’s getstandardfee sounds like a nice quick win for the time being :slight_smile:

The broader point this thread raises here is that if wallets and indexers cannot assume nodes behave 100% the same, teams working on these tools need an easy way to know where node behavior may differ to properly abstract differences away to prevent potential leakages down the road.

idk if there is smthg like that already, but is there a short ‘differences with other nodes’ doc listing known Zebra / Zakura differences (fees, relay policy, RPC behaviour)?

The PR was opened and merged in the space of about 7 hours. To my understanding, nobody was really aware of this until afterwards.

Still to date, no user has communicated getStandardFee as a relevant query, nor do I understand why a wallet wants to query a full node for it, when they only do their read-queries against indexer services.

Its an indirection for a later dynamic fee market perhaps, but as-is doesn’t make sense to read off a node at all until there is a variance or divergence strategy planned.

Its been updated to 1000 zats on Zakura, and been separated from mempool admission policy. As far as I’m concerned, this is presently deadcode being requested in every binary, and any user using it has no idea what to do in the face of updates or divergence between nodes. Is it expected to only update at EOS deadlines? How does that even work with multiple node implementations?

I am interested if wallets start using it, and why they are! As-is, this does not make sense to me, and IMO you should just hardcode it or query multiple nodes and use the max of them.

@Autotunafish

getstandardfee is being adopted, and we have been actively and directly reaching out to wallet developers over the last few weeks/months to keep them up to date and advocate for its use.

  1. Use getstandardfee for transaction fees, supporting Zebra’s 1,000-zat logical-action rate · Issue #357 · zcashme/zns-mint · GitHub
  2. Zcash: get the fee from getstandardfee and add a 'pay more for inclusion' option · Issue #7310 · horizontalsystems/unstoppable-wallet-ios · GitHub
  3. Zcash: get the fee from getstandardfee and add a 'pay more for inclusion' option · Issue #9806 · horizontalsystems/unstoppable-wallet-android · GitHub

@ValarDragon:

Yes, getstandardfee is the indirection for the dynamic fee market Shielded Labs is building. It allows wallets to follow fee changes automatically, which is how we avoid threads exactly like this one :). A world where every node and wallet has their own constant(s) that they need to keep track of and update is, IMO, haphazard.

Wallets only reading from indexers is exactly the intended path. lightwalletd v0.6.1 already serves GetStandardFee over gRPC, relaying the node’s value. The interface is on the full node because the node already holds all the data the estimator will need. It’s a matter of convenience and availability.

Updating it to 1000 and separating it from mempool admission policy is not what I would have recommended. I think the nodes should have the same marginal fee value and that’s what should be communicated, and I’m agnostic as to whether that value is 400 or 1000. It’s just important to me that wallets don’t have to pay attention to what the node devs are doing like they currently do.

2 Likes

I was referring to the zebra devs as being unaware. This thread is specifically about Zakura and Zebra devs, not wallet devs.

Then I’m afraid I don’t understand where the breakdown in communication was. This was approved and merged in July: feat(rpc)!: add `getstandardfee` RPC returning the ZIP-317 marginal fee by aphelionz · Pull Request #10717 · ZcashFoundation/zebra · GitHub

Also, several other follow-up PRs have all taken the RPC call into account.

1 Like

The issue was the minimum fee, which seems to have been fixed.

1 Like