Replying to Avatar Super Testnet

> Your project swaps coinbase transactions for payment transactions, right?

Yes. The miner gives you X sats from their next coinbase if and only if you give them X+Y sats, where Y is a premium.

> The repo could need some documentation

Ok I will add more documentation, thanks!

> It's an atomic swap between a transaction that pays the miner via high mining fees and a mining reward? I pay one of my own addresses with a 1BTC mining fee and the miner pays me 1BTC from the coinbase transaction?

No, the miner gives you a pubkey and you use it to create a swap address using Gregory Maxwell's coinswap technique. The swap address – which I call Swap Address A – allows your pubkey to withdraw after a timelock, otherwise the miner's pubkey can withdraw if you give him a secret, otherwise you can cooperate to spend the money without revealing the secret. You deposit funds into this address and send some info about it to the miner.

Then the miner creates an equivalent swap address – Swap Address B – which is locked to the same secret, except everything's reversed: his pubkey can withdraw after a timelock, your pubkey can withdraw using the secret which you already know, or you can spend the funds cooperatively without revealing the secret. The miner uses Swap Address B as the destination for part of the next coinbase he mines, so now both sides have committed funds.

Then you reveal to the miner the secret that allows you to take the money in Swap Address A and him to take the money in Swap Address B. With this information in hand, the miner and you do not actually *use* the secret (because that would publicly reveal information that links the swap) but instead you cooperatively spend the money in Swap Address A to the miner and he cooperatively spends the money in Swap Address B to you. The resulting transactions look like ordinary 1-of-1 taproot transactions with no funkiness, and they reveal nothing that indicates a swap happened.

So the miner doesn't get paid in fees but in a normal transaction. And neither can the miner mine a second transaction into the same block, spending the payment transaction mostly in fees but he can do that to pay out future swaps to ramp up the coinbase transaction. But that could also muddy these pristine UTXOs.

To conceal the swap, both miner and client should optionally provide more than one address.

Reply to this note

Please Login to reply.

Discussion

> So the miner doesn't get paid in fees but in a normal transaction

Correct

> neither can the miner mine a second transaction into the same block, spending the payment transaction mostly in fees

I'm less sure about that part. When the miner sweeps the money from Swap Address A, he's perfectly allowed to pay dust (or less) to his "real" address and use the rest of the utxo as a transaction fee. But if he does that, it will be a pretty clear fingerprint that will allow chain analysts to identify Swap Address A as a swap address. For best privacy, the miner should gradually spend the money in Swap Address A in transactions that look relatively normal.

> he can do that to pay out future swaps to ramp up the coinbase transaction

Yes, I hope that the extra revenue they make ends up increasing the relative size of coinbase transactions, which should make mining pool members happy

> But that could also muddy these pristine UTXOs

How would it muddy them? I suspect there are ways miners can use a utxo to contribute to the coinbase via a series of transactions that look perfectly normal, in a way that I don't think chain analysts can't easily detect

One pool having consistently 1BTC more fees to pay out and paying out to these buyers will stand out and analysis companies - although they don't know which payout it is - will know to which degree the utxo swaps are happening. They will also know which TX was not in other mempools and its high fee will stand out anyway.

This way, unregulated mining pools will definitely have a huge financial edge over those regulated pools that wouldn't touch this.

> One pool having consistently 1BTC more fees to pay out and paying out to these buyers will stand out

hopefully they won't stick out for long because more pools will join the fun too -- every miner loves extra fees!

> They will also know which TX was not in other mempools and its high fee will stand out anyway.

I'm not sure of that. I suspect miners have ways of doing this that analysts can't detect. I doubt chain analysts can see every transaction in every mempool. And there's no reason the fees have to be high. Miners can use normal fee sizes and keep them going for a longer time.