By the way I think it’d be good to implement the recommended fee in CounterTools (the simple method "Target confirmation time: 10|30|60 minutes"
) and then submit a PR to CW.
Reference: Counterwallet’s fee setting:
};
var COUNTERWALLET_CONF_LOCATION = "/counterwallet.conf.json";
var NUMERIC_ASSET_ID_MIN = bigInt(26).pow(12).add(1);
var NUMERIC_ASSET_ID_MAX = bigInt(256).pow(8);
var SUBASSET_MAX_DISP_LENGTH = 20;
var IS_MOBILE_OR_TABLET = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
var MAX_INT = Math.pow(2, 63) - 1;
var UNIT = 100000000; //# satoshis in whole
var MIN_FEE = 20000; // in satoshis (== .0002 BTC)
var REGULAR_DUST_SIZE = 5430;
var MULTISIG_DUST_SIZE = 7800;
var MIN_BALANCE_FOR_ACTION = 50000; //in satoshis ... == .0005
var ASSET_CREATION_FEE_XCP = 0.5; //in normalized XCP
var SUBASSET_CREATION_FEE_XCP = 0.25; //in normalized XCP
var DIVIDEND_FEE_PER_HOLDER = 0.0002
var MAX_ASSET_DESC_LENGTH = 41; //42, minus a null term character?
var FEE_FRACTION_REQUIRED_DEFAULT_PCT = .9; //0.90% of total order
And for Counterparty Server API:
unspent = backend.get_unspent_txouts(source, unconfirmed=allow_unconfirmed_inputs, multisig_inputs=multisig_inputs)
# filter out any locked UTXOs to prevent creating transactions that spend the same UTXO when they're created at the same time
if UTXO_LOCKS is not None and source in UTXO_LOCKS:
unspentkeys = set(make_outkey(output) for output in unspent)
filtered_unspentkeys = unspentkeys - set(UTXO_LOCKS[source].keys())
unspent = [output for output in unspent if make_outkey(output) in filtered_unspentkeys]
unspent = backend.sort_unspent_txouts(unspent)
logger.debug('Sorted candidate UTXOs: {}'.format([print_coin(coin) for coin in unspent]))
use_inputs = unspent
# use backend estimated fee_per_kb
if estimate_fee_per_kb:
estimated_fee_per_kb = backend.fee_per_kb(estimate_fee_per_kb_nblocks)
if estimated_fee_per_kb is not None:
fee_per_kb = max(estimated_fee_per_kb, fee_per_kb) # never drop below the default fee_per_kb
logger.debug('Fee/KB {:.8f}'.format(fee_per_kb / config.UNIT))
inputs = []
Defaults in Counterparty Server:
BURN_END_MAINNET = 283810
# Protocol defaults
# NOTE: If the DUST_SIZE constants are changed, they MUST also be changed in counterblockd/lib/config.py as well
# TODO: This should be updated, given their new configurability.
# TODO: The dust values should be lowered by 90%, once transactions with smaller outputs start confirming faster: <https://github.com/mastercoin-MSC/spec/issues/192>
DEFAULT_REGULAR_DUST_SIZE = 5430 # TODO: This is just a guess. I got it down to 5530 satoshis.
DEFAULT_MULTISIG_DUST_SIZE = 7800 # <https://bitcointalk.org/index.php?topic=528023.msg7469941#msg7469941>
DEFAULT_OP_RETURN_VALUE = 0
DEFAULT_FEE_PER_KB = 25000 # sane/low default, also used as minimum when estimated fee is used
ESTIMATE_FEE_PER_KB = True # when True will use `estimatefee` from bitcoind instead of DEFAULT_FEE_PER_KB
ESTIMATE_FEE_NBLOCKS = 3
# UI defaults
DEFAULT_FEE_FRACTION_REQUIRED = .009 # 0.90%
DEFAULT_FEE_FRACTION_PROVIDED = .01 # 1.00%
DEFAULT_REQUESTS_TIMEOUT = 20 # 20 seconds
DEFAULT_RPC_BATCH_SIZE = 20 # A 1 MB block can hold about 4200 transactions.
@jdogresorg in #L88 of this last file, you can set your target estimate to 6 blocks if you want.
Today when I was writing that Bash script I realized that 10 and 30 mins fees were exactly the same (based on several tests I did with the API)