Overview
A scheduled transaction is a type of transaction that allows you to publicly collect all the required signatures on the network. For example, Transaction A requires signatures from Alice, Bob, and Carol. Alice can schedule and sign Transaction A using the schedule transaction. Alice also specifies an expiry time for Transaction A during creation. Once the schedule transaction is successfully executed and posted on the network Alice can call Bob and Carol to sign the transaction. Bob and Carol can sign the schedule transaction by submitting a schedule sign transaction. Transaction A will automatically execute once it receives the minimum required signatures. However, if the required signatures are not received by the specified expiry time, Transaction A will not execute. Alice can optionally set the transaction to execute automatically at its expiry time. In this case, even if all required signatures are applied to the transaction, the transaction will wait until the expiry time to execute. Unlike other Hedera transactions, this one allows you to queue a transaction for future execution (up to two months into the future). This feature is ideal for transactions that require multiple signatures and would benefit from being submitted on-chain. The transaction types that can be scheduled in a schedule transaction as of Consensus Node Release 0.57 are the following:TransferTransactionTokenMintTransactionTokenBurnTransactionAccountCreateTransactionAccountUpdateTransactionFileUpdateTransactionSystemDeleteTransactionSystemUndeleteTransactionFreezeTransactionsContractExecuteTransactionContractCreateTransactionContractUpdateTransactionContractDeleteTransaction
Creating a Schedule Transaction
When a schedule transaction is created, the following information will need to be specified in theScheduleCreateTransaction.
Scheduled Transaction ID
The Transaction ID of the transaction that needs to be scheduled. You will need to create the transaction that you would like to schedule prior to creating the schedule transaction. Once you have created the transaction you want to schedule, you will need to specify that transaction ID in this field. Admin Key Setting an admin key on a schedule transaction allows the user to cancel or delete the schedule transaction, if needed. This key is optional to set. If this key is not set upon creation, the transaction cannot be deleted. Expiration Time The expiration time is a timestamp for specifying when the transaction should be evaluated for execution and then expire. The maximum allowed value is 62 days (5356800 seconds).- Scheduled Transactions will execute at the earliest available consensus time after their expiration time on a best-effort basis.
- When set to true, the transaction will be evaluated for execution at expiration_time instead of when all required signatures are received.
- When this flag is set to false, the transaction will execute immediately after sufficient signatures are received
Create A Schedule Transaction
Signing and Submitting a Schedule Transaction
Before submitting your scheduled transaction, you must sign it with the key of the account responsible for paying the schedule transaction fees and, optionally, the key of the transaction fee payer account for the scheduled transaction, if specified. Additionally, if your signature is required for the scheduled transaction, you can sign theScheduleCreateTransaction using that key.
After a ScheduleCreateTransaction successfully executes, the receipt will include the schedule ID and the scheduled transaction ID. The schedule ID is a unique identifier used to reference the created schedule transaction. The scheduled transaction ID represents the transaction scheduled by the schedule transaction. Scheduled transaction IDs include a ?scheduled flag at the end (e.g., 0.0.1234@1615422161.673238162?scheduled), indicating it is a scheduled transaction. This ID inherits the valid start time and the account ID from the original schedule transaction.
You can request the current state of a schedule transaction by querying the network for ScheduleGetInfoQuery using the schedule ID. The request will return the following information:
- Schedule ID
- Account ID that created the schedule transaction
- Account ID that paid for the creation of the scheduled transaction
- Transaction body of the transaction that was scheduled
- Transaction ID for the transaction that was scheduled
- Current list of signatures
- Admin key (if any)
- Expiration time
- The timestamp of when the transaction was deleted, if true
Get Schedule Info
Signing the Scheduled Transaction
After the schedule transaction is submitted, the scheduled transaction becomes available for on-chain signing. Required parties can use aScheduleSignTransaction to add their signatures to the scheduled transaction. Once the minimum number of signatures is collected, the transaction will automatically execute, unless it is configured to wait until the expiry timestamp.
Scheduled Transaction Record
Once the schedule transaction successfully executes, the transaction record is made available. To get the transaction record for the scheduled transaction after successful execution, you can do the following:
- Poll the network for the specified scheduled transaction ID. Once the schedule transaction executes the scheduled transaction successfully, request the record for the scheduled transaction using the scheduled transaction ID.
- Query a Hedera mirror node for the scheduled transaction ID.
- Run your own mirror node and query for the scheduled transaction ID.
Sign A Schedule Transaction
Deleting a schedule transaction
A schedule transaction can be deleted if an admin key was set during its creation. If no admin key was set, the schedule transaction cannot be deleted.Delete A Schedule Transaction
Tutorial/Examples
Schedule Your First Transaction
FAQ
What is the difference between a schedule transaction and scheduled transaction?
What is the difference between a schedule transaction and scheduled transaction?
Is there an entity ID assigned to a schedule transaction?
Is there an entity ID assigned to a schedule transaction?
ScheduleCreateTransaction.What transactions can be scheduled?
What transactions can be scheduled?
How can I find a scheduled transaction that requires my signature?
How can I find a scheduled transaction that requires my signature?
- The creator of the schedule transaction can provide you a schedule ID which you specify in the
ScheduleSignTransactionto submit your signature.
What happens if the scheduled transaction does not have sufficient balance?
What happens if the scheduled transaction does not have sufficient balance?
Can you delay a transaction once it has been scheduled?
Can you delay a transaction once it has been scheduled?
What happens if multiple users create the same schedule transaction?
What happens if multiple users create the same schedule transaction?
- The first transaction to reach consensus will create the schedule transaction and provide the schedule entity ID
- The other users will get the schedule ID in the receipt of the transaction that was submitted. The receipt status will result in
IDENTICAL_SCHEDULE_ALREADY_CREATED. These users would need to submit aScheduleSignTransactionto append their signatures to the schedule transaction.
When does the scheduled transaction execute?
When does the scheduled transaction execute?
How often does the network check to see if the scheduled transaction has met the signature requirement?
How often does the network check to see if the scheduled transaction has met the signature requirement?
How do you get information about a schedule transaction?
How do you get information about a schedule transaction?
When does a schedule transaction expire?
When does a schedule transaction expire?
What does a schedule transaction receipt contain?
What does a schedule transaction receipt contain?