Add spend_redeemer
to matches
#163
Replies: 1 comment 1 reply
-
I am also adding another use-case here: I think that this would have a significant impact and propose that either a) this is only implemented to be optionally enabled by users or b) this is not implemented at all and users are advised to implement custom chain indexers for more complex setups using i.e. chain synchronization directly. |
Beta Was this translation helpful? Give feedback.
-
Hi,
As per its user documentation, Kupo currently returns for a matched UTxO something like
Below, I would like to discuss the possible addition of the fields,
spend_redeemer
andspend_script_context
to this response in case an UTxO was witnessed by one when spent.To start off, the why, in some complex decentralized applications, mutable state is represented succinctly via, for example, merkle tree's or other opaque vector commitment schemes (accumulators or even verkle trees). With the introduction of such data structures, the script checks that state transitions of these possible big data structures are done correctly via small proofs. But with this opaqueness, a bootstrapping problem arises, that is, “how does a new instance that would like to use the application know what the latest succinct data represents?”.
An obvious solution is to publicly communicate via some offchain channel what the latest state is, which then can be checked against the latest commitment onchain. But a concern with this method is that it requires the user to connect to a possible centralized point, revealing the identity of the user (among other infrastructure issues).
Another, more decentralized way would be to bootstrap each user from the initial state when the dApp was created onchain. In this case, a user applies each transaction that it sees happening onchain in the same order to its local initial state, which eventually leads to knowing the latest state.
To do the latter via kupo, we can track the UTxO + some asset that makes the state unique across the slots, and for each transition recover the redeemer + context easily to deduce how the state transitions.
I have no idea on the technical implication of Kupo for this (especially for the context), what do you think?
Beta Was this translation helpful? Give feedback.
All reactions