3

It's been told here that the cost of a unilateral exit depends on the number of leaves of the shared vtxo tree, which determines the number of transactions one has to broadcast to complete the process.

Why does the unilateral exit require multiple transactions to be broadcasted?

1 Answer 1

3

In Ark, all virtual tx outputs (vtxos) are actually outputs on the leaf txs of a binary tree of transactions. The reason for this is two-fold: so that a single person exiting doesn't have to broadcast all the vtxo outputs for all vtxos in the Ark tx and so that in the case of mass exit, the process smoothens out and there is more time for everyone to exit slowly.

You could think of the vtxo tree of a tree of transactions that each have one input and two outputs and like that they form a tree structure. Think of these transactions as transactions that are already pre-specified upfront. They can either be pre-signed or pre-specified using introspection opcodes. This means that all these transactions are valid Bitcoin transactions and could all in theory be confirmed. However, they don't carry any fee and no one has an incentive to broadcast them to the network.

Such a tree might look like this: enter image description here

In this tree, there are 4 leaves, A, B, C and D; they are actual valid transaction outputs and we will call them "vtxos". Virtual because they are not confirmed yet, but can be confirmed if they would be mined.

Now, for the vtxo A to be confirmed, let's say because its owner wants to spend the money on-chain, all the transactions going from the on-chain output (the top-most "cov") towards the leaf A have to be confirmed on the chain.

enter image description here

Because this is a binary tree, the number of nodes in a branch is log2(n) where n is the number of leaves, plus one for the leaf itself. So that means log2(4) + 1 is 3 transactions to be confirmed.

7
  • 1
    How can these txs be broadcasted if they have no fees? maybe CPFP?
    – altafan
    Commented Sep 29, 2023 at 15:45
  • 1
    Yeah that is something still in the design phase. CPFP is definitely the most obvious option. Even though the nature of the timelocks makes it non-trivial. Probably a (ephemeral) fee anchor output would be required if we use pre-signed txs or OP_CTV. Commented Sep 29, 2023 at 16:21
  • 1
    Does one person paying out their vtxo necessitate that other users participating in that batch also go on-chain?
    – Murch
    Commented Oct 2, 2023 at 18:07
  • Let's say A and B want to unilaterally exit the ark at the same time, they would try to broadcast the same chain of txs, wouldn't they? How would this be handled?
    – altafan
    Commented Oct 3, 2023 at 12:55
  • > Let's say A and B want to unilaterally exit the ark at the same time, they would try to broadcast the same chain of txs, wouldn't they? How would this be handled? -- @altafan I would say that if B waits for A to broadcast, then B will only need to broadcast one transaction
    – bordalix
    Commented Oct 4, 2023 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.