Account creation fee operation

On the Coda Protocol, when an account is first created an account creation fee is charged. As currently implemented, we do not know if the fee will be charged until we look at a ledger to ensure that the receiver’s account already exists (it won’t be charged) or it doesn’t (it will be charged).

Is it acceptable to model this as an operation that appears in every transaction (if looked up outside of the block context) and whose status becomes “Failed” when applied against a ledger where the account already exists?

If this is unacceptable, we can also make a protocol change to make account creation more explicit in the transaction payload, though we would like to avoid this if possible.

Is it acceptable to model this as an operation that appears in every transaction (if looked up outside of the block context) and whose status becomes “Failed” when applied against a ledger where the account already exists?

Fortunately, confirmed transactions can never be looked up outside of the “block context” in the Rosetta Data API (AKA it is not possible to lookup a transaction by hash without providing the block hash where it occurred). Requests to the /block endpoint trivially have the block context and requests to the /block/transaction endpoint must include the block context (both index and hash).

When designing Rosetta, we found that lookups outside of the “block context” would require Rosetta implementations to either store a lot of additional data around each transaction or make a lot of assumptions. We classified this sort of query as an explorer endpoint that should be provided by some service built on top of a Rosetta Data API implementation, not by a Rosetta Data API implementation itself.

Is it acceptable to model this as an operation that appears in every transaction (if looked up outside of the block context) and whose status becomes “Failed” when applied against a ledger where the account already exists?

I would not recommend including a failed operation in each transaction if such a fee was not charged. This may give the impression to certain clients that their transactions did not apply correctly (if they consider a transaction broadcast successful if no failure operations are observed). Hopefully, the clarification above resolves this issue!

Note on Mempool Transactions

Transactions retrieved from the /mempool/transaction endpoint are assumed to be a “best effort” representation of what may occur on-chain and you could chose to either default to showing the fee or not. Clients using this endpoint assume responses here may not accurately depict what occurs on-chain (ex: consider an ETH transfer with tons of internal transactions).

1 Like