Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hedera Schedule Service System Contract #755

Merged
merged 6 commits into from Jul 14, 2023

Conversation

Nana-EC
Copy link
Contributor

@Nana-EC Nana-EC commented Jun 15, 2023

Description:
This proposal addresses the feature gap of a smart contracts ability to issue scheduled transactions via the HAPI scheduled transactions.

Since smart contracts executions do not utilize the Hedera signature map they are unable to carry along the authorizations that the Hedera ledger uses to confirm an accounts participation and acknowledgment in a transaction.

To address this Smart Contracts could utilize the Hedera Schedule Service by submitting a scheduled transaction to which accounts can sign / authorize as an acceptance of the desired transaction. This flow provides as easy route for asynchronous coordination of transaction approval.

Related issue(s):

Fixes #

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
@netlify
Copy link

netlify bot commented Jun 15, 2023

Deploy Preview for hedera-hips ready!

Name Link
🔨 Latest commit d9065b6
🔍 Latest deploy log https://app.netlify.com/sites/hedera-hips/deploys/64b1476a13e4b00008278479
😎 Deploy Preview https://deploy-preview-755--hedera-hips.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>

Since smart contracts executions do not utilize the Hedera signature map they are unable to carry along the authorizations that the Hedera ledger uses to confirm an accounts participation and acknowledgment in a transaction.

To address this Smart Contracts could utilize the Hedera Schedule Service by submitting a scheduled transaction to which accounts can sign / authorize as an acceptance of the desired transaction. This flow provides as easy route for asynchronous coordination of transaction approval.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To address this Smart Contracts could utilize the Hedera Schedule Service by submitting a scheduled transaction to which accounts can sign / authorize as an acceptance of the desired transaction. This flow provides as easy route for asynchronous coordination of transaction approval.
To address this, Smart Contracts could utilize the Hedera Schedule Service by submitting a scheduled transaction which accounts can subsequently sign / authorize to indicate acceptance of the desired transaction. This flow provides an easy route for asynchronous coordination of transaction approval.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


In many decentralized scenarios a contract may issue a transaction that would require participation by multiple entities.

However, under the Hedera Smart Contract Service (HSCS) Security Model v2 it is not possible to authorize a contract in advance to modify an accounts property or cause a debit to their balance without their authorization. This essentially means multi party operations made challenging if not infeasible on smart contracts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
However, under the Hedera Smart Contract Service (HSCS) Security Model v2 it is not possible to authorize a contract in advance to modify an accounts property or cause a debit to their balance without their authorization. This essentially means multi party operations made challenging if not infeasible on smart contracts.
This essentially means multi party operations are made challenging if not infeasible when using smart contracts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


## Rationale

By providing a secure mechanism to acquire asynchronous authorization from multiple accounts, smart contracts can continue to be used for more decentralized operations whiles still maintaining the integrity of account sovereignty by allowing accounts to approve confirm their participation in a transaction.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By providing a secure mechanism to acquire asynchronous authorization from multiple accounts, smart contracts can continue to be used for more decentralized operations whiles still maintaining the integrity of account sovereignty by allowing accounts to approve confirm their participation in a transaction.
By providing a secure mechanism to acquire asynchronous authorization from multiple accounts, smart contracts can continue to be used for more decentralized operations while still maintaining the integrity of account sovereignty by allowing accounts to approve and confirm their participation in a transaction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


## Specification

The ledger HSCS will utilize the existing scheduled transaction service supported on the ledger within the system contract logic.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ledger HSCS will utilize the existing scheduled transaction service supported on the ledger within the system contract logic.
HSCS will utilize the existing scheduled transaction service supported on the ledger within the system contract logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


Since `signSchedule(address scheduleAddress) returns (int64 responseCode)` relies on an implicit signature it will only callable by EOA’s via the IHRC facade.
In this case the signature will be the inner ECDSA signature found in the RLP encoded `EthereumTransaction`.
For `Contract` and `ContractCreate` any applicable signature found in the signature map will be utilized as in `ScheduleSign`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I understand what this sentence means? What is ScheduleSign referencing?

Copy link
Contributor Author

@Nana-EC Nana-EC Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is referencing the ScheduleSign transaction. Basically, just as the network pulls signatures for ScheduleSign it should also pull signatures from the map for ContractCall and ContractCreate if the execution logic applies to scheduled transactions

## Security Implications

Existing security consideration such as throttles will remain applicable.
Additional considerations may include
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finish or remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the section are the completion of the section. Let me update it to be more explicit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

mgarbs and others added 2 commits June 26, 2023 11:50
Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
@Nana-EC Nana-EC requested a review from lukelee-sl July 6, 2023 00:25
Nana-EC and others added 2 commits July 5, 2023 19:27
Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
@mgarbs mgarbs marked this pull request as ready for review July 14, 2023 13:04
@mgarbs mgarbs merged commit a7741cf into hashgraph:main Jul 14, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants