Module: protocol/consensus

Members

(static, constant) BASE_REWARD :Amount

Base block subsidy (consensus).

Type:
Source:

(static, constant) COIN :Amount

One handshake in dollarydoos.

Type:
Source:

(static, constant) EXP :Number

Coin exponent.

Type:
  • Number
Default Value:
  • 6
Source:

(static, constant) GENESIS_KEY :Buffer

Genesis key.

Type:
  • Buffer
Source:

(static, constant) GENESIS_REWARD :Amount

Block subsidy specifically for the genesis block.

Explanation: The max miner subsidy is 680000000, but due to the halving interval it actually ends up as 679999995.79, so add 2.21 coins to the genesis reward output to make MAX_MONEY a thoroughly true value.

This, combined with the 3 1/4 year halving interval, causes the supply to run dry after about 100 years (around the year 2119, or height=5,270,000).

Type:
Source:

(static, constant) HEADER_SIZE :Number

Block header size.

Type:
  • Number
Default Value:
  • 236
Source:

(static, constant) LOCKTIME_FLAG :Number

Locktime flag.

Type:
  • Number
Source:

(static, constant) LOCKTIME_GRANULARITY :Number

Locktime granularity.

Type:
  • Number
Default Value:
  • 9
Source:

(static, constant) LOCKTIME_MASK :Number

Locktime mask.

Type:
  • Number
Source:

(static, constant) LOCKTIME_MULT :Number

Locktime multiplier.

Type:
  • Number
Source:

(static, constant) MAX_AIRDROP :Amount

Maximum airdrop amount in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_BLOCK_OPENS :Number

Maximum block tree opens.

Type:
  • Number
Default Value:
  • 300
Source:

(static, constant) MAX_BLOCK_RENEWALS :Number

Maximum block tree renewals.

Type:
  • Number
Default Value:
  • 600
Source:

(static, constant) MAX_BLOCK_SIGOPS :Number

Maximum block sigops cost (consensus).

Type:
  • Number
Default Value:
  • 80000
Source:

(static, constant) MAX_BLOCK_SIZE :Number

Maximum block base size (consensus).

Type:
  • Number
Default Value:
  • 1000000
Source:

(static, constant) MAX_BLOCK_UPDATES :Number

Maximum block tree updates.

Type:
  • Number
Default Value:
  • 600
Source:

(static, constant) MAX_BLOCK_WEIGHT :Number

Maximum block weight (consensus).

Type:
  • Number
Default Value:
  • 4000000
Source:

(static, constant) MAX_CA_NAMING :Amount

Maximum CA/naming amount in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_CREATORS :Amount

Maximum creators amount in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_DOMAIN :Amount

Maximum domain holder amount in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_INITIAL :Amount

Maximum initial supply in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_MONEY :Amount

Maximum amount of money in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_MULTISIG_PUBKEYS :Number

Max n value for multisig (consensus).

Type:
  • Number
Default Value:
  • 20
Source:

(static, constant) MAX_RAW_BLOCK_SIZE :Number

Maximum block serialization size (protocol).

Type:
  • Number
Default Value:
  • 4000000
Source:

(static, constant) MAX_SCRIPT_OPS :Number

Max opcodes executed (consensus).

Type:
  • Number
Default Value:
  • 201
Source:

(static, constant) MAX_SCRIPT_PUSH :Number

Max script element size (consensus).

Type:
  • Number
Default Value:
  • 520
Source:

(static, constant) MAX_SCRIPT_SIZE :Number

Max serialized script size (consensus).

Type:
  • Number
Default Value:
  • 10000
Source:

(static, constant) MAX_SCRIPT_STACK :Number

Max stack size during execution (consensus).

Type:
  • Number
Default Value:
  • 1000
Source:

(static, constant) MAX_SPONSORS :Amount

Maximum sponsors amount in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_SUBSIDY :Amount

Maximum amount of subsidies in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_TLD :Amount

Maximum TLD holder amount in dollarydoos (consensus).

Type:
Source:

(static, constant) MAX_TX_SIZE :Number

Maximum TX base size (consensus).

Type:
  • Number
Default Value:
  • 1000000
Source:

(static, constant) MAX_TX_WEIGHT :Number

Maximum TX weight (consensus).

Type:
  • Number
Default Value:
  • 4000000
Source:

(static, constant) MEDIAN_TIMESPAN :Number

Size of set to pick median time from.

Type:
  • Number
Default Value:
  • 11
Source:

(static, constant) NONCE_SIZE :Number

Block header nonce size.

Type:
  • Number
Default Value:
  • 24
Source:

(static, constant) SEQUENCE_DISABLE_FLAG :Number

Highest nSequence bit -- disables sequence locktimes (consensus).

Type:
  • Number
Source:

(static, constant) SEQUENCE_GRANULARITY :Number

Sequence granularity for time (consensus).

Type:
  • Number
Default Value:
  • 9
Source:

(static, constant) SEQUENCE_MASK :Number

Sequence mask (consensus).

Type:
  • Number
Default Value:
  • 65535
Source:

(static, constant) SEQUENCE_TYPE_FLAG :Number

Sequence time: height or time (consensus).

Type:
  • Number
Source:

(static, constant) WITNESS_SCALE_FACTOR :Number

Amount to multiply base/non-witness sizes by.

Type:
  • Number
Default Value:
  • 4
Source:

(static, constant) ZERO_HASH :Buffer

A hash of all zeroes.

Type:
  • Buffer
Source:

(static, constant) ZERO_HEADER :Buffer

Block header of all zeroes.

Type:
  • Buffer
Source:

(static, constant) ZERO_NONCE :Buffer

Block header nonce of all zeroes.

Type:
  • Buffer
Source:

Methods

(static) fromCompact(compact) → {BN}

Convert a compact number to a big number. Used for block.bits -> target conversion.

Parameters:
Name Type Description
compact Number
Source:
Returns:
Type
BN

(static) getReward(height, interval) → {Amount}

Calculate block subsidy.

Parameters:
Name Type Description
height Number

Reward era by height.

interval Number

halving interval.

Source:
Returns:
Type
Amount

(static) hasBit(version, bit) → {Boolean}

Test version bit.

Parameters:
Name Type Description
version Number
bit Number
Source:
Returns:
Type
Boolean

(static) toCompact(num) → {Number}

Convert a big number to a compact number. Used for target -> block.bits conversion.

Parameters:
Name Type Description
num BN
Source:
Returns:
Type
Number

(static) verifyPOW(hash, bits) → {Boolean}

Verify proof-of-work.

Parameters:
Name Type Description
hash Hash
bits Number
Source:
Returns:
Type
Boolean