USDM round-trip, a ZK invoice contract, and every wall I hit on the way
Over the sprint I moved USDM Cardano → Midnight → Cardano, built a web front-end for the bridge, and shipped an original Compact contract that settles USDM invoices in zero knowledge. Repos: Front-end: https://github.com/CjDabrow/usdm-bridge-frontend (demo: https://cjdabrow.github.io/usdm-bridge-frontend/ ) Payments DApp: https://github.com/CjDabrow/midnight-private-invoices (demo:…
In the sprint, the author moved USDM from Cardano to Midnight, created a web front-end for the bridge, and launched an original Compact contract that settles USDM invoices using zero-knowledge proofs. The documentation provided little guidance on how VIA carries USDM, but the process involves locking USDM at VIA's lock-release script and minting native USDM on Midnight.
The author observed the multi-step transfer, noting that the released USDM ends up in the enterprise address rather than the base address, and advised checking the alternative address if the initial one appears empty.
A key challenge was understanding the proof server, which must match the version to the ledger Docker image. The proof server's major version should align with the ledger version, and the Docker Hub tag should correspond to a future ledger. The author ran the proof server on macOS using colima and mentioned that initial sync and wallet state cache can significantly speed up subsequent runs.
The author also discussed the importance of DUST, a time-parameterized balance that accrues over hours. They explained how to register for dust generation, manage the registration fee, and query the balance using a timestamp to avoid confusion with undefined values. For the Compact contract, the author highlighted the need to design around USDM, using a private invoice registry where invoices exist on-chain as hashed data and are settled in USDM through ZK proofs.
The contract manages private settlement facts, while the payment command handles native unshielded USDM transfers, minimizing complexity and circuit usage.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.