There's a similar question here. I've read it but still got some questions.
I know the transaction fee is simply lamports_per_signature
* number_of_signatures
(plus a little miner tip). However, what is number_of_signatures
exactly?
Inside the transaction data, we should specify an array of accounts, denoting which accounts are to be used in this transaction. I'm wondering what number_of_signatures
is in each of the following cases:
- There are 2 accounts in the array and both are signers. However, these 2 accounts are in fact the same account. i.e., I'm passing duplicated accounts.
- There are 2 accounts in the array, and the first is signer, the second is not. These 2 accounts are actually the same too.
- There are 3 different accounts in the array. The first is signer, the second is not and it's a PDA. The third is a program account. Inside one of the instructions, the program performs a CPI to the third account, and the second account (PDA) becomes a signer.
lamports_per_signature
is dynamically changed. Seems it does nothing with my question