Proof of Possession in the Stardust protocol #80
lunfardo314
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Doesn't this make it impossible to vote on multiples things at the same time? I cast a vote for a governance decision on 1 chain, but my funds are locked until deadline, so I can't vote on anything else until the deadline expires and the UTXO becomes consumable. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proof of Possession in the Stardust protocol
Summary
There's no way to prove possession of certain assets by the address to the Stardust VM on L2 without explicitly sending funds to it. This makes it impossible such contacts as DAO voting based on possession of tokens.
The root cause is a design decision of the L1 protocol: eventual pruning of all transactions and impossibility to extract transaction for an UTXO deterministically.
The least breaking solution it seems to be introduction of the Proof of Possession Feature Block.
Use case
The possibility of such a proof of possession has been envisioned as a part of ISC concept since beginning by including the on-ledger voting request and the Proof of Possession (PoP) into the same request transaction. This way the VM would have a PoP in the SC without any additional trust. In the pre-Stardust implementation it was possible because L2 VM had access to the whole transaction, not just request UTXO.
Specifically:
Unfortunately, this is only possible if the whole transaction is available in the context of the request. Such DAO contract is not possible with the current protocol design.
Why this is happening?
Absence of the ledger transactions containing unspent UTXOs in the ledger state a serious tradeoff in the protocol.
Main motivation for transaction pruning is optimization of storage. This is justified for the transactions without unspent outputs, however, in general each transaction contains a very crucial information, a proof of atomic ledger update and a proof of atomic inclusion of elements of transaction: inputs, outputs, unlock blocks/signatures etc. The transaction ID is the commitment to the atomic state update. It is important as a context of unspent outputs.
Nodes keep transactions enwrapped into Tangle messages for some time/epochs otherwise nodes wouldn't be able to sync. It is possible to retrieve the transaction for the output while it is still there. However, from the POV of the L2 app, availability of the transaction becomes non-deterministic, because ultimately the transaction is pruned after some time even if it contains unspent outputs.
This non-determinism caused by protocol optimization makes the L1 VM assume the transaction in general is not available. This, in turn, brings about functional limitations and attack vectors, which, when known, should be patched some other way with ad hoc protocol elements:
We may speculate if the list above is final or not (for example, knowing a list of signers of the transaction in SC may be very handy too). In any case, any such addition it a heavy process of updating L1 protocol.
The most flexible solution for L2 VM would be access to the whole transaction containing on-ledger request output in the context of the VMs sandbox.
A plan to go on with the DAO voting
It seems that introduction of Proof of Possession feature block (PoPFB) is the most realistic approach to enable the DAO voting contract.
Here's a sketch for the PoPFB to be discussed.
The PoPFB syntax
(skipping details such as type prefixes and lengths. Real spec may differ)
PoPFB = OwnedAssets [Deadline], i.e. the PoPFB proves certain amount of assets owned by the sender (see below) until optional Deadline.
OwnedAssets is one of:
In those rare cases when you need to prove ownership of several types of assets in one output, you put several blocks of this type into the transaction. Alternatively, the PoPFB may be specified to include multi-asset proof. That would be semantically equivalent.
Semantically, OwnedAssets states that the sender (signer or alias) of the transaction owns (possesses) at least the specified amount of assets until the Deadline, inclusively.
The Deadline, if present, specifies a moment in time (real time and/or milestone index) until which the ownership of tokens by sender of the transaction is guaranteed by the L1 protocol.
If Deadline is absent, the protocol guarantees only ownership of said assets in the context of containing transaction. It means, for the consumer of the output, ownership is deterministically proven but it is not guaranteed otherwise.
The PoPFB always goes with the Sender feature block in the same output.
Validation rules
If PoPFB is present in the output, for the whole transaction to be valid the transaction, the Sender block must be present in the same output.
In addition, the transaction must contain another output or outputs called proving outputs which proves the ownership statement. Specifically:
Other
Adding the PoPFB block won't be breaking for the L1. It would require expanding the Stardust VM of ISC with few sandbox functions.
PoPFB will enable possible voting and many other applications on L2.
The client side (e.g. Firefly) will have to be extended with the concept of Proof of Possession. The key point is that by sending on-ledger request to the SC you can add a prove you own some asset(s) for some time by locking it for some time but not giving up the control of it to anybody else. The SC may access the prove and act accordingly to its logic: voting, authorization etc
Beta Was this translation helpful? Give feedback.
All reactions