I want to be able to fund account creation only if account is going to add myself as an additional signer for this account. I thought on creating transaction with SetOptions operation that will set thresholds and add myself as an additional signer. The account that should be created will send me signed transaction with SetOptions operation. Then I submit account creation request followed by signed transaction with SetOptions operation. Problem is that it seems to be no way to sign transaction when sequence number is unknown and sequence number cannot be retrieved for non-existing account. Is there workaround? Thanks.
You can build a transaction with 2 operations in it to achieve this.
G...ZAUCis your account
G...ONYIis the account you want to create
- Source of the transaction is A
- First Operation: Create account B
- Second Operation: Set the weights and add A to B signers, the source of the operation is B.
Since B is the source of an operation but not of the transaction, we don't need to know its sequence number.
Both accounts will have to sign the transaction before sending to the network