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

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

Description

@oleganza

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    consensusIssues affecting consensus-level compatibilityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions