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

Revisit fee structure #3369

Closed
tromp opened this issue Jun 27, 2020 · 4 comments
Closed

Revisit fee structure #3369

tromp opened this issue Jun 27, 2020 · 4 comments
Assignees
Labels
P1: Critical Top priority for a release
Milestone

Comments

@tromp
Copy link
Contributor

tromp commented Jun 27, 2020

The current minimum relay fee rules use

accept_fee_base = 1000000

as set in the default grin-server.toml.
Since this is in units of nanogrin, it expresses a base cost of 1 milli-grin.
This is what you pay for each unit of a transaction weight, which is defined in

/// Calculate transaction weight from transaction details. This is non
/// consensus critical and compared to block weight, incentivizes spending
/// more outputs (to lower the fee).
pub fn weight(input_len: usize, output_len: usize, kernel_len: usize) -> usize {
let body_weight = output_len
.saturating_mul(4)
.saturating_add(kernel_len)
.saturating_sub(input_len);
max(body_weight, 1)
}

as the linear combination 4 * #outputs + 1 * #kernels + (-1) * #inputs, with a minimum of 1.
This means that a typical tx with 2 outputs, 1 input and 1 kernel requires a relay fee of 8 milligrin,
currently worth about 1/3 cent.

We should revisit this base fee and tx weight coefficients to provide a good long term balance
between spam resistance and tx affordability. It would also be nice to make the tx weight coefficients seem less arbitrary.

@lehnberg
Copy link
Collaborator

Is there some fee structure that could promote privacy preserving output selection? Recall the discussion in #2186 for instance.

For example, what if we could inceltivize 'balanced' transactions? (two inputs spend to two outputs), or some other structure that makes the tx graph better obfuscated.

@tromp
Copy link
Contributor Author

tromp commented Jun 27, 2020

Yes, we should consider incentivizing privacy enhancing transactions.
A tx with 2 inputs and 2 outputs is already cheaper in fees than a tx with only 1 input and 2 outputs.

@lehnberg lehnberg added the P1: Critical Top priority for a release label Oct 14, 2020
@lehnberg lehnberg added this to the 5.0.0 milestone Oct 14, 2020
@lehnberg
Copy link
Collaborator

#3481

@antiochp
Copy link
Member

Closing - included as part of 5.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1: Critical Top priority for a release
Projects
None yet
Development

No branches or pull requests

3 participants