|Author||John Conway, Walter Hernandez|
|Needs Council Approval||No|
Table of Contents
Enable smart contract interaction with the Hedera Consensus Service, by allowing contracts to create, read, and write to HCS topics.
Interoperability between the HCS and smart contracts would enable developers to leverage HCS-stored data in their dApps.
By enabling smart contracts to interact with the HCS, this would allow the creation of HCS-based Oracles. For example, a smart contract could subscribe to a private or public topic in order to read its external data, such as the prices of crypto-assets.
This would also enable topic-based NFT minting rights. A smart contract could ingest an HCS topic to calculate the user’s available NFTs. Then, after minting the NFT and transferring it to the user, the smart contract could update that same HCS topic. Currently, this process is only achievable via a centralized, server-based chain of events (such as on https://hashandslash.io).
Any other Oracle use case could be repurposed by the HCS.
As a developer, I want to be able to read HCS topics from my smart contracts.
As a developer, I want to be able to send HCS topic messages from my smart contracts.
As a developer, I want to be able to create HCS topics from my smart contracts.
Enabling smart contracts to interact with HCS topics would follow the same approach as the https://hips.hedera.com/hip/hip-206.
With regards to signing transactions from within a smart contract, the main concern is storing private keys in-state. So, some possible solutions are:
- Give a different kind of permission to deployed smart contracts for interacting with certain topics. This could function similarly to how AWS differentiates between key-based permissions and role-based permissions.
- Follow the same approach from the https://hips.hedera.com/hip/hip-206 to signing transactions and interacting with topics.
This document is licensed under the Apache License, Version 2.0 – see LICENSE or (https://www.apache.org/licenses/LICENSE-2.0)
Please cite this document as: