wormhole-foundation / wormhole

A reference implementation for the Wormhole blockchain interoperability protocol.
https://wormhole.com
Other
1.68k stars 690 forks source link

External Entity: Account State Attestation #149

Closed hendrikhofstadt closed 3 years ago

hendrikhofstadt commented 3 years ago

To allow external chains to use and verify state data from Solana such as DEX prices, balances (TVL) and other information, there needs to be an attestation mechanism.

Wormhole EE-VAAs (#147) allow for new message types to be implemented. This proposal introduces a message type that attests on-chain state for Solana, more specifically it approves that at a certain slot S the data in an account A had the sha-256 hash H.

uint64 slot
[32]byte account
[32]byte hash

In order to make attestations trustworthy despite them being an External Entity VAA, we'll deploy a standardized emitter that will handle an instruction AttestAccountInstruction which takes any solana account, calculates its data hash using the sol_sha256 syscall and CPIs to the Wormhole contract EmitEEVAAInstruction to emit a EE-VAA event with the body as specified above.

Guardians will pick the log message up, attest the event emitted and subsequently produce a VAA containing the attester program as emitter and account and hash as data.

Due to such events being emitted regularly, the resulting VAAs will not be persisted on-chain (as per EE-VAA convention). Consumers need to actively listen to the Wormhole P2P network and propagate VAAs to where they should be consumed.

leoluk commented 3 years ago

Part of the v2 design :tada:

@hendrikhofstadt Please re-open if I'm mistaken - but it looks like this is superseded by the emitter design?