Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

zkvm: readonly-access to contracts [DRAFT] #490

Open
oleganza opened this issue Nov 30, 2020 · 0 comments
Open

zkvm: readonly-access to contracts [DRAFT] #490

oleganza opened this issue Nov 30, 2020 · 0 comments
Labels
consensus Issues affecting consensus-level compatibility enhancement New feature or request

Comments

@oleganza
Copy link
Contributor

oleganza commented Nov 30, 2020

Some smart contracts depend on third party data ("oracle"). Currently it can only be implemented as a signed program, which is not as secure as it could be: the publisher could selectively send conflicting data to different parties. One way to improve this is to permit "readonly access to UTXOs". Meaning, the UTXO commitment is proven to exist, its contents are opened and read, but UTXO is not consumed and there is no linear type (Value) to be consumed.

Use case

A future contract bound to the third party's price announcement packaged as an on-chain contract. When the price changes, third party updates their utxo. When contract owners need to update balances or close the contract, they use the "read" access communicate the updated price to their contract.

Proposal

  1. A new instruction read that acts similar to an input: checks that UTXO exists, instantiates a contract object.
  2. Anchor is not updated by the read instruction, because that would allow duplicate anchors, since several txs are allowed to read a UTXO.
  3. read fails if the contract contains a Value type. Readable contracts must contain only Strings and Programs.
@oleganza oleganza added consensus Issues affecting consensus-level compatibility enhancement New feature or request labels Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
consensus Issues affecting consensus-level compatibility enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant