Zcash Shielded Asset Swaps and Transaction Acceptance

by ZSAs do do you mean mostly stablecoins and other kind of assets?

i personally would like to see someone build sth similar to pump.fun so everyone could issue and launch ZSAs in 5minutes - these wouldnt have to be just memecoins, could be anything. but a simple launching platform is needed imo to get activity for ZSAs.

and some sort of exchange.

5 Likes

Love this. A prerequisite for in-browser fun is WebZjs being stable and supporting ZSAs. We’ll get there!

2 Likes

Someone should also contact the teams behind wrapping bridges such as Portal.

1 Like

Hi all,

I’ve read through the discussion and wanted to share my thoughts on the proposal. Firstly, I understand the frustration around the slow implementation of ZSAs and the high cost of this new proposal. However, I also see the potential benefits of Asset Swaps and the value they could bring to the Zcash ecosystem.

I appreciate the concerns raised around the lack of programmability on the chain and the need for automatic market makers. However, I believe that the implementation of Asset Swaps could be a step towards enabling more advanced features in the future.

Regarding the amount of work required for this proposal, I agree with those who feel that it may be underrepresented. It’s important to ensure that the scope of work is clearly defined and that the cost reflects the actual amount of engineering required.

I also think that it’s crucial to maintain transparency and open communication around the implementation of new features. It’s important to keep the community informed about the progress and any changes to the proposal.

Overall, I believe that the implementation of Asset Swaps could be a valuable addition to the Zcash ecosystem, but it’s crucial to ensure that the scope of work is clearly defined and that the cost reflects the actual amount of engineering required. I look forward to hearing more about the proposal and the progress made.

- Best, Akira

1 Like

Reach out to CDP protocols. The odds of getting a big protocol to do this ASAP is low.
I suggest reaching out to Joey Roth from DYAD. I have a direct line with him.

If you want an intro, please let me know.

I already put the plan together (screenshot attached).

1 Like

Dear Zcash Community,

We’re sharing here our progress in the last few weeks on the Asset Swaps implementation and transaction acceptance design.

Transaction Acceptance (User Control) Design

  • We are happy to share that we have opened a pull request to the zips repository with our transaction acceptance ZIP draft - this is PR#980. This marks the completion of Milestone #4 of our grant!
  • A preview of the rendered version of the ZIP is here.

Asset Swaps Implementation (orchard, librustzcash, Zebra)

  • We have continued making changes to the orchard crate to add the Swaps functionality. Our latest work is being developed on PR#141.
  • We have also been implementing the changes to the librustzcash crate in order to support Asset Swaps as per the specification in ZIP 228. The draft version of this can be seen here.

Asset Swap P2P matching implementation for zcash_tx_tool

  • We will be updating our zcash_tx_tool, which we have been using to generate transactions for Zebra nodes, to also be able to generate Swap Transactions. Currently, we plan to implement functionality that allows a party to create a Swap Transaction from two distinct Swap Orders. This is done for protocol viability demonstration and is not a full exchange implementation.

Looking forward to hearing from you all!

Best,

The QEDIT Team.

11 Likes

Dear Zcash Community,

We’re sharing here our progress on the Asset Swaps implementation. Our last post marked the completion of the transaction acceptance research and ZIP work — we are happy to hear any comments on that!

  • We have continued making changes to the orchard crate to add the Swaps functionality. Some of our recent work here has been catching up to the changes that have been made in the crate for our NU7 development work, which is still in progress. We also have added a flag to signify whether Swaps are enabled or not, analogous to having enable_zsa, enable_spends, or enable_outputs as present for NU7. This work can be tracked in PR#116.
  • We have similarly been implementing changes to the librustzcash crate in order to support Asset Swaps, such as the updates to the orchard crate mentioned above. The draft version of this can be seen here.
  • We are currently focusing our zebra and zcash_tx_tool efforts on pushing the necessary updates for ZSAs in NU7, and we are waiting for the codebase to stabilise a bit more before we add in the swaps functionality.

Looking forward to hearing from you all!

Best,

The QEDIT Team.

6 Likes

Dear Zcash Community,

We’re sharing here our progress on the Asset Swaps implementation:

  • The updates to the orchard crate to add the Swaps functionality continue to progress. This also includes catching up to the changes that have been made in the crate for our NU7 development work, which is still being reviewed and improved. This work can be tracked in PR#116.
  • We have similarly been implementing changes to the librustzcash crate in order to support Asset Swaps, such as the updates to the orchard crate mentioned above. The draft version of this can be seen here.
  • There is now a branch of the zcash_tx_tool repository with the Asset Swap functionality. This can be tracked in this pull request. This will also continue to be updated based on the NU7 changes.

Looking forward to hearing from you all!

Best,

The QEDIT Team.

8 Likes

Dear Zcash Community,

Our Asset Swaps implementation builds on the changes made to the Zcash Protocol for the introduction of Zcash Shielded Assets (ZSAs). As such, our work towards this project has also involved ensuring this work remains on top of the work we have been doing to implement ZSAs (recent monthly status updates for which can be seen here, here and here).

Some Swaps-specific updates are as follows:

  • ZIP 228 has been revamped. The original ZIP included definitions of Action Groups and various other pieces which were subsequently front-loaded into ZIP 230 to reduce the need for many back-to-back transaction format updates. We have accordingly accounted for these inclusions in ZIP 230, along with the introduction of SIGHASH versioning in ZIP 246, and removed redundant parts from ZIP 228. The rendered version of this can be seen here, and we have PR#780 to the zips repository which is ready for review by the ZIP editors, for the inclusion of this ZIP in draft format.
  • Working branches. On the orchard repository, we have the zsa_swap branch, on the librustzcash repository we have the zsa-swap branch, on the zebra repository we have the zsa-swap branch, and on the zcash_tx_tool repository, we have the zsa-swaps branch. These branches are all rather close to being caught up to the latest changes in our ZSA working branches.
  • We are also in the home stretch of a working end-to-end implementation of the Swaps functionality, using the transaction tool to generate transactions that work with the zebra node. We are in the process of final review, and ensuring all the branches are caught up to upstream changes, and ironing out any dependency mismatches between the various repositories.

We are expecting to have this completed and submitted in the coming weeks… so stay tuned!

Best,
The QEDIT Team.

6 Likes

Dear Zcash Community,

We have some exciting implementation updates to share with you! We demonstrated the end-to-end functionality of ZSAs including Swaps on a ZecHub community call last week - you can have a look at the recording here.

Updates across the development stack to create this implementation of the Swaps + ZSA functionality can be seen in the following pull requests to the various repositories:

Repository Pull Request Swaps working branch
orchard PR#116 zsa_swap
librustzcash PR#99 zsa-swap
zebra PR#96 zsa-swap-multiple-ag
zcash_tx_tool PR#23 zsa-swap

Running Locally

It is possible to test the functionality locally via the steps described in the README of the zcash_tx_tool repository. The most relevant section is reproduced below:

Prerequisites

  • Docker: Install Docker

  • Rust & Cargo: Install Rust and Cargo

  • Diesel CLI: Installed via Cargo.

  • Linux Dev tools:

    sudo apt update
    
    sudo apt install pkg-config libssl-dev libsqlite3-dev
    

Getting Started

1. Build and Run the Zebra Docker Image

Open a terminal and execute the following commands:

# Clone the zebra repository with the ZSA swaps branch
git clone -b zsa-swap-multiple-ag --single-branch https://github.com/QED-it/zebra.git

# Navigate to the testnet deployment directory
cd zebra

# Build the Zebra Docker image
docker build -f testnet-single-node-deploy/dockerfile -t qedit/zebra-regtest-txv6 .

# Run the Zebra Docker container
docker run -p 18232:18232 qedit/zebra-regtest-txv6

For more details on how the Docker image is created and synchronized, refer to the Dockerfile in the zebra repository.

2. Set Up and Run the Zcash tx-tool

In a separate terminal window, perform the following steps:

One-Time Setup

Install Diesel CLI and set up the database and get Zcash Params for Sapling:

# Install Diesel CLI with SQLite support
cargo install diesel_cli --no-default-features --features sqlite

# Set up the database
diesel setup

# Get Zcash Params for Sapling (if needed)
./zcutil/fetch-params.sh

Build and Run a Test Scenario

There are multiple test scenarios provided in the repository, viz.

Build and run the test case of your choice using the Zcash Transaction Tool, by replacing <test-case> in the command below with either of the test scenarios listed above:

# Build and run with ZSA feature enabled
cargo run --release --package zcash_tx_tool --bin zcash_tx_tool <test-case>

For example, to run the test-orchard-zsa scenario, use:

cargo run --release --package zcash_tx_tool --bin zcash_tx_tool test-orchard-zsa

Note: To re-run the test scenario (or to run a different scenario), reset the Zebra node by stopping and restarting the Zebra Docker container.

Connecting to the public testnet

A dedicated AWS node has been set up to run the version of the Zebra node that has been updated for swaps. The URL to connect to this node, and detailed and updated instructions for connecting and running your test scenarios can be found on this Wiki link. We also provide these details here:

To connect to the Swaps node, the URL is https://dev.zebra-swaps.zsa-test.net/

Environment Variables

Start by setting the following environment variables:

# For the ZSA Swaps testnet
export ZCASH_NODE_ADDRESS=dev.zebra-swaps.zsa-test.net
export ZCASH_NODE_PORT=443
export ZCASH_NODE_PROTOCOL=https

Clone the zsa-swaps branch of the transaction tool:

# Clone the zcash_tx_tool repository with the ZSA swaps branch
git clone -b zsa-swap --single-branch https://github.com/QED-it/zcash_tx_tool.git

Then run the desired test scenario:

# Build and run with ZSA feature enabled
cargo run --release --package zcash_tx_tool --bin zcash_tx_tool <test-case>

where <test-case> can be replaced with any of the scenarios already constructed (eg test-asset-swaps), or your own test scenario if you choose to construct your own.

This will automatically connect to the ECS node and run the scenario on it after syncing with the existing blocks.


This corresponds to milestones #1 and #2 of our User Control for ZSAs grant. We look forward to you testing out these tools and letting us know what you think!

Best,

The QEDIT Team.

3 Likes