Well, revealing our “tech” (there’s a paper on it! so it’s nothing new nor secret), it’s just a Blake2b transaction digest tree of a 1-in-1-out Action schema. It’s nothing fancy, really, you just precompute the Sapling/Transparent digests because they are constant (0-in-0-out), and then take the pk_d, g_d and compute a commitment. It’s the principle that’s novel, not the mechanism.
As for the code that generates the txID verbatim, that would be:
function compute(
uint32 version,
uint32 versionGroupId,
uint32 consensusBranchId,
uint32 lockTime,
uint32 expiryHeight,
bytes32 compactDigest,
bytes32 memosDigest,
bytes32 noncompactDigest
) external view returns (bytes32 txidOut, bytes32 ironwoodDigestOut) {
bytes32 h = headerDigest(version, versionGroupId, consensusBranchId, lockTime, expiryHeight);
ironwoodDigestOut = ironwoodDigest(compactDigest, memosDigest, noncompactDigest);
txidOut = txid(h, ironwoodDigestOut, consensusBranchId);
}
and
Action.Inputs memory inputs = abi.decode(actionAbi, (Action.Inputs));
(
bytes32 compactDigest,
bytes32 memosDigest,
bytes32 noncompactDigest,
bytes32 cmx0,
bytes32 nf0,
bytes32 nf1
) = abi.decode(computeAbi, (bytes32, bytes32, bytes32, bytes32, bytes32, bytes32));
bytes32 actionCmx = action.commitNote1(inputs);
if (actionCmx != cmx0) revert CmxMismatch();
bytes32 txid = _computeTxid(r, compactDigest, memosDigest, noncompactDigest);
Pretty standard stuff. It relies on the concept that you don’t NECESSARILY need to associate the signature (which is segregated as spendAuthSig tree) into the effects tree, and secondly, you don’t HAVE to check if the input notes are valid, as the network’s validators do the job for you. So you’re free to let the user set the input note parameters wholesale blindly, as the network would reject them for you. So the only things you really need per-se is the output note details, such as p_k, g_d, v, and blinding factors, and optionally nullifier (but we recommend deriving it from a network-wide fair randomness function such as the Beacon Chain digests)
Right now we are not encapsulating the cmx generation in a NIZK due to compute constraints (254-bits is too constrained, we’re moving to 381-bit, we even tried to implement Halo2 on EVM)
The “replay vulnerability” is that transaction ID generation does NOT differ between mainnet and testnet, but we are solving that by fixing finality (proving the finality belongs to the mainnet via anchor blocks)