decred.org/dcrwallet/v3@v3.1.0/wallet/txrules/doc.go (about) 1 // Copyright (c) 2015 The btcsuite developers 2 // Copyright (c) 2015 The Decred developers 3 // Use of this source code is governed by an ISC 4 // license that can be found in the LICENSE file. 5 6 /* 7 Package txrules provides functions that are help establish whether or not 8 a transaction abides by non-consensus rules for things like the daemon and 9 stake pool. 10 11 # Dust and Fee Per KB Calculation 12 13 Please refer to mempool.go in dcrd for more information about the importance 14 of these function. 15 16 # Pool Fees 17 18 The pool fee is calculated from the percentage given according to the 19 following formula: 20 21 ps(v+z) 22 f = -------------- 23 s+v 24 25 where f = absolute pool fee as an amount 26 p = proportion (e.g. 0.5000 = 50.00%) 27 s = subsidy (adjusted two difficulty periods into the future) 28 v = price of the ticket 29 z = the ticket fees 30 31 This can be derived from the known relation that 32 ps = (f * (v+z)/(v+s)) obtained from the knowledge 33 that the outputs of the vote are the amounts 34 of the stake ticket plus subsidy (v+s) scaled by 35 the proportional input of the stake pool fee 36 f/(v+z). 37 38 f is then adjusted for the fact that at least one subsidy reduction is 39 likely to occur before it can vote on a block. 40 */ 41 package txrules