Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 206 forks source link

Document how voters can currently safely validate a governance proposal to instantiate a contract #6086

Open kriskowal opened 2 years ago

kriskowal commented 2 years ago

What is the Problem Being Solved?

We currently lack documentation for the workflow for proposing and validating governance proposals that would, for example, upgrade a contract.

Description of the Design

By way of a preliminary sketch:

To propose a new contract installation, one would need to

To verify a governance proposal that includes a E(zoe).install({ endoZipBase64Sha512 }) command in a bootstrap script:

and/or verify the bundle is consistent with the sources of the contract from a repository and hash:

Security Considerations

Validating a contract currently requires obtaining the sources at a particular hash, installing their dependencies, reconstructing the bundle, matching the generated hash, then inspecting the contract proper for malfeasance. Improperly installing the dependencies of an arbitrary application can empower an attacker to run arbitrary code with the authority of the user.

Test Plan

dckc commented 1 year ago

a 1-off attempt: game1-bundles.mk

https://devnet.agoric.explorers.guru/proposal/9 on agoricdev-20

dckc commented 1 year ago

Case studies:

See also a web-based prototype tool:

dckc commented 4 days ago

Testnet case studies: