Private Preconfs: Above and Beyond 25s

regtest doesn’t mean you will succeed on mainnet. Very different topologies and mining.
You need:

  • to send a self-payment tx first to a node
  • pay the merchant before their node gets the self-payment tx from p2p
  • your self-payment gets mined first

good luck!

Yes I am aware :slight_smile: I dont think there is a much better way to test though, at least not without funds… Maybe I can try between a few wallets actually on mainnet.

The way I am thinking about it is that success is dependent on the connectivity of the merchants node and the attackers node. I guess an assumption I am making is that the merchant is running a node with more or less default settings, and an attacker has a lot of ways to to optimize his other tx getting dispersed to more hashpower than the other tx first. I am aware it is a race of course! I was actually thinking of sending the conflicting spend AFTER I send the merchant the other tx, and still getting my conflicting spend dispersed more quickly

I assume your underlying point you want to make is that if it is already very difficult to do a conflicting spend, such a protocol is not justified? If an attacker can only win the data race 5% of the time, would you think it is still strong enough of a guarantee for a merchant to trust big shot XYZ’s service?

I think for either direction to be usable enough to gain wide adoption, it would probably have to be considerably below this. In either case, we should think about what should happen when a conflicting spend goes through anyways. Cause it could happen in both.

We have a lot of relevant data within the relay network. Https://relay.sovright.com . We are investing and caching the mempool on a near realtime basis.

We have right resolution orphan block coverage. We can pretty easily build a detector that show what fraction of txs are invalidated.

I’ll DM with @distractedm1nd about getting the data he needs.

Generally I think a preconf network could get sufficient miner adoption without making consensus changes.

My point is that it is a complex problem that has received a lot of study. I am not saying you can’t be on something new, but it’s your job to convince people that you have. Kinda like Einstein when his theory of Relativity.

1 Like

When I was still working in the BCH space I started working on an idea very similar to this, but I’m not sure zcash has the script/signing capability of implementing it (to my knowledge zcash script is the same as bitcoin). But the idea was something like this:

Funds are put into an address which can only be spent from by the owner, Alice, but to spend them Alice also needs a signature from a preconf service. So when spending Alice’s wallet sends a request for the signature from the preconf service which provides it and then Alice can complete the transaction and send it to the network for inclusion in a block.

The magic occurs because separately there is another special address on the blockchain with a bunch of funds in it we can call the assurance pool. The assurance pool is locked for some period of time (say a month) and can be burnt if a two signatures are found signing a two transactions where they both have the same inputs, but differing outputs (I.e. the definition of a double spend).

Because a merchant can easily verify the that the transaction Alice has sent comes from an address with a script of the preconf format, with a signature from the preconf service, AND that there is a locked assurance pool that could be burnt should a double-spend of those funds appear on the network, then they can know that while a double-spend is technically possible, it would be economically irrational for the preconf service to allow it.

All the preconf service would need to do is never allow a double-spend of the UTXOs.

I’d love to learn more about what is possible inside a zcash transaction, especially inside the shielded part. If this could be done with complete privacy it would be pretty awesome!

That sounds like something adaptor signatures could do, but if the preconf service is not losing anything, then what prevents them from just never giving you the key, or worse, extorting you for it?

Actually, the shielded part is not programmable, since the circuitry needs to be the exact same in every validator, and the transactions are designed to look the exact same to everyone to preserve anonymity. So it only supports one primitive, which is an “action”, essentially just a transfer of value.

There was a separate part of the script which allows the owner to spend with only their own signature after a timelock expires. So the funds have to keep being re-entered into a new address periodically.

I don’t recall either Orchard or Sapling ever having any sort of timelock, because to enforce a timelock, a node needs to be able to decrypt the timelock instruction, which is not possible.

Although I do not dispute that it must have been available in transparent Zcash.

Ah, that’s what I thought. Do you happen to have a good source for what exactly happens in the private part of the transaction? I’m very interested to understand whats possible. I think with future upgrades there could be some very interesting possibilities for DarkFi on zcash within the shielded part of the transaction.

Sure! The Zcash Protocol Specification: https://zips.z.cash/protocol/protocol.pdf

However, it is a LOT of reading, even with an AI (which often gets confused or jumbles things up), so I’ll summarise it for you!

Essentially, and this is VERY paraphrased, but basically:

In Orchard, there are no inputs or outputs. Instead, there is only one primitive, the “Action”, which simply denotes the movement of positive funds from point A to point B. A transaction must have enough actions to account for all funds going in or out.

Each Action consists of a nullifier (a random string you reveal to let others know that your signature has been spent, derived via your nullifier derivation key), and a note commitment hash (cmx), which represents components of the note you claim to spend. The cmx, the nullifier, etc, all then become the next cmx for when your money needs to be spent.

To emulate an “input”, you simply input money (i.e. spend a note) by creating an Action, but the recipient is a dummy address. Once you do this, the funds have “entered” the transaction. Then in the same transaction, you create another Action with an input value of 0 and a dummy input note (i.e. it will use funds already available in the transaction) and use a legitimate recipient to send the funds to the recipient.

Every Orchard transaction must have two or more Actions, to maintain the anonymity set, i.e. an input and an output.

After you create your transaction, you then generate an authentication digest, which you then sign. This signature signs each individual part of the transaction.

Then you generate a Halo2 proof (the Orchard Action circuit) that runs a computation to prove that all aspects of the transactions are correct, such as the nullifier exists and the balance is correct, and other things.

Once this is done, the transaction is sent as-is to the validators, who merely verify the proof and be done with it.

The issue with it is that the circuit the validators use to verify a transaction, they have the same gates as the one you use to send your transaction. So every validator can only ever verify the exact computation you did. The validators cannot perform any other computations that you didn’t do, since the proof uses private inputs that are not revealed.

That’s why it is impossible to program any DarkFi within an Orchard transaction.

Thank you! That’s very helpful. The relevant parts of the whitepaper wrt the shielding are pretty difficult to understand coming in cold.