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

Documentation uses "Account Creation Fee" in multiple ways and should be clarified. #930

Open
pgebheim opened this issue Apr 21, 2022 · 2 comments
Labels
Document A document or group of documents for publication on the Docs Site or elsewhere (eg totorial, blog) Feedback

Comments

@pgebheim
Copy link
Contributor

Portions of the documentation site use the phrase "account creation fee" in an overloaded manner, which can be quite confusing to reconcile. This is particularly true now that the Segmented Transaction Fees documentation is live.

Examples:

I think to clear this up we should do two things:

  • Align on the terminology here. Is the initial 0.001 flow an account creation fee, or is it a "minimum storage balance"
  • Segmented Transction Fee documentation should:
    • Refer to the operation as "AuthAccount" instead of the descriptive "create account"
    • Point to the documentation on storage fees for new accounts and note that the "minimum storage balance" must still be satisfied by the payer.
@pgebheim pgebheim added Feedback Document A document or group of documents for publication on the Docs Site or elsewhere (eg totorial, blog) labels Apr 21, 2022
@pgebheim
Copy link
Contributor Author

pgebheim commented Apr 21, 2022

For more information on how the "AuthAccount" fee is used vs "Create Account" in the colloquial sense.

When a wallet or dapp creates an account for a user two things occur:

  • User submits a key to the dapp/wallet which should be associated with the account (or the dapp/wallet makes one)
  • The dapp/wallet then executes a cadence transaction [example below], this transaction is charged a transaction fee which is paid by the payer who signs the transaction.
  • When the account is made, the AuthAccount function is passed a payer account, which covers the cost of the storage minimums (0.001 flow)

The change that is introduced in Segmented Transaction Fees doesn't change any of the above workflow, it simply increases the amount of "execution effort" (gas) used by the AuthAccount function.

For example, here is a simple cadence script to create an account and add 1 key.

import Crypto
transaction(publicKey: String, signatureAlgorithm: UInt8, hashAlgorithm: UInt8, weight: UFix64) {
    prepare(signer: AuthAccount) {
        let key = PublicKey(
            publicKey: publicKey.decodeHex(),
            signatureAlgorithm: SignatureAlgorithm(rawValue: signatureAlgorithm)!
        )

        // THIS LINE now uses a different amount of execution effort
        // than it would have previously.
        // BEFORE segmented fees: "1 gas"
        // AFTER segmented fees: "43 gas"
        // the *payer* here is the account from which the account minimum (0.001 flow) is transferred.
        let account = AuthAccount(payer: signer)

        account.keys.add(
            publicKey: key,
            hashAlgorithm: HashAlgorithm(rawValue: hashAlgorithm)!,
            weight: weight
        )
    }   
}

@alxflw alxflw removed their assignment Jun 21, 2022
@alxflw
Copy link
Contributor

alxflw commented Jun 21, 2022

will add it to the backlog to review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Document A document or group of documents for publication on the Docs Site or elsewhere (eg totorial, blog) Feedback
Projects
No open projects
Status: 🆕 Need to be discussed
Development

No branches or pull requests

2 participants