Ahead of the 10th anniversary.... programmability* comes to shielded Zcash!

I know, I know, you’re probably tired of us making yet another announcement. Our researchers are proud to say they have figured it out and are now introducing programmable composable locks to shielded Zcash, which are (mostly)^ shielded and fully anonymous! HTLCs, witness locks, preimage locks, even encryption locks galore!

TL;DR: This breakthrough allows two parties to negotiate a provably secure lock such that the funds can only be spent on certain conditions, such as:

  • Providing a certain witness
  • Providing the preimage to a certain hash, essentially, requiring that you know the original text of a certain hash
  • (Still in development) providing the decryption key to a certain piece of encrypted text
  • A certain time or block height having being reached^
  • Cannot spend once a certain height has been reached

Meanwhile, the funds can still be recovered from the lock by all parties’ collaboration.

This was built on the backs of FROST, so I guess we thank their developers. The core primitive is called Violet’s Constrained Locks, which takes an algorithm and a DKG to securely generate a lock by messaging off-chain.

In the process, we invented several types of new sub-protocols, such as:

  • hashFROST
  • preFROST
  • (in-dev) encFROST

Conditions marked with ^ leak certain details to outside observers, that is: the existence of the lock, and when the lock is spent. These will disappear provided two things are done: One ZIP is clarified and another ZIP is passed. If you wish to see them being entirely shielded, support the inclusion of ZIP 68 and clarification of [protocol spec] [ZIP 203] Clarify how transaction lock times are handled · Issue #539 · zcash/zips · GitHub

Anyways, we will soon be releasing the vcl crate so you can all experiment with it, as well as machine checked proofs!

Preliminary paper: Violet's Constrained Locks, or: How I Learned to Stop Worrying and Love Scriptless Chains · 2026/0002

Example transactions:

Example of What it reveals What it doesn’t reveal Transaction link
Setting up a hash-lock, Poseidon hash The existence of the lock as a 54-zat transparent output Any shielded address or any involved shielded amounts Zcash Transaction 7714868cd5...0e09d3 | ZecBlock
Claiming a hash-lock in reveal mode, Poseidon hash Which lock was claimed, the preimage (only to the other party) Same as above Zcash Transaction 743299510c...68f036 | ZecBlock
Refunding a hash-lock, Poseidon hash Same as above, no preimage is revealed Same as above Zcash Transaction 18f2490d69...942b2e | ZecBlock

As always, if you support our work (or have ANY questions), please engage with this, and let us know!

8 Likes

Further, via this, two other applications of Zcash can now be made (and is being made by our team)!

  • A one-way streaming protocol for Zcash similar to Sablier but entirely shielded
  • A proto-Lightning for Zcash, termed as ELSA (Efficient Layer-2 Schnorr-based Apparition), also entirely shielded
1 Like

So with what you’ve built, two parties agree on a fixed set of transactions in advance - did I understand this correctly?

It’s not two parties as much as two keys, but essentially, yeah.

OK. And what part of this runs on-chain, and what part of it can be combined with other contracts?

Only the endpoints of the transaction run on the chain, as reduced Schnorr signatures, similar to how FROST already works. Majority of the computation happens off-chain.

“Other contracts” I’m sorry, there are no other contracts on Zcash at present. However, the primitives themselves are composable, as multiple locks can be chained to execute only in sequence (if one of them is invalidated, the rest cannot execute), however, composability is as far as you can go.

We will, however, do more research on combining different transactions in a new combination round, now that you’ve piqued our interest in the field.

Could you provide any examples where combinations of spending paths may be required?

I also forgot to mention that via state locks, we also enforce the one-outpoint-per-lock rule, which allows multiple spending paths to branch off a single state. This allows something like a refund path and a state transition path to coexist, allowing HTLCs and escrows.

Perhaps I could, but I was just trying to understand what part of this is actually providing “programmability.” Perhaps not the correct framing/terminology for what you’re building.

A few points things I’ve noticed:

  1. The only thing stopping counterparties from forging a spend is a property with a proof plan. Your HTLC properties are only wireframed, and your Halo 2 recursion is working on the assumption that it is secure, with zero proof.
  2. Your testnet demo used a Poseidon hash lock? The paper specifies SHA-256. I would wire the circuitry before implying the demo exists; it’s just constructed on paper atm.
  3. Unsure about your ZIP fix you’ve described. The issue (#359) you’ve referenced has been open since 2021, and is intended to document how lock handles are handled, and you’re referring to this whole thing as a consensus rule. Inaccurate/untrue. The further you parse it out, the more it sounds like the real fix you’re looking for would require a new ZIP + NU to ship it, which wouldn’t be a bad idea.
  4. “(mostly)* shielded” is downplaying a way bigger leak considering there’s a public link from funding tx → closing tx, in addition to a distinct 2-of-2 script when it’s spent.
  5. Might be pertinent to mention that a stream dies with every network upgrade. Some consideration for being more honest about longevity matters imo.

Not really touching the Sablier style streaming + ELSA channel piece, since there’s no actual paper out :sweat_smile:

1 Like

You are absolutely right, the unforgeability property is currently just a proof plan, as we are still machine checking it. However, a human check would confirm that it is fully viable as it inherits most of its security from FROST, and the added parts adhere to various proof protocols.

I’m not sure how that is relevant to the post? Both Orchard and Zakura Common ship a SHA256 chip, and we are not making any claims about it in this post.

??? We have clarified about it with Daira-Emma Hopwood herself, the person assigned to the issue. She said that yes, the fix would indeed fix it, and also told us the reason it was missed.

We… literally disclose it. In the table. “Existence of the lock” and “which lock was claimed”. It is still mostly shielded because addresses and amounts are fully private.

Now this is something I genuinely agree we missed, yes, consensus branch ID changes may invalidate channels. But they would invalidate channels, and we haven’t dropped the channels paper yet.

Overall, felt a lot nitpicky rather than helpful, but thanks for your input!

Further, I updated the post to say composable rather than programmable. You’re right, it is not truly programmable as much as it is composable, so we rephrased it.

1 Like