mimblewimble / grin-explorer

Blockchain explorer for grin
GNU Affero General Public License v3.0
59 stars 53 forks source link

fees vs block reward (units are inconsistent) #10

Closed antiochp closed 6 years ago

antiochp commented 6 years ago

For example - https://grinexplorer.net/block/5df58803ba2df2eb3f649bd1cae11e93ffb8f649b075169fd0709764a4a2046c

Block reward is 50 grin Fees should be considerably less than that (milligrins?)

image

hendi commented 6 years ago

If grin has 8 decimal places like Bitcoin, the fee in your screenshot would be 0.02 grin. If that assumption is correct I'll push a display fix for this tomorrow.

antiochp commented 6 years ago

Yeah I'm pretty sure we use 8 decimal places. 50 grin == 5,000,000,000 (from mimblewimble/grin#232).

antiochp commented 6 years ago

Actually from the code here - https://github.com/mimblewimble/grin/pull/241/files

50 grin == 50,000,000,000

And consensus.rs -

/// A grin is divisible to 10^9, following the SI prefixes
pub const GRIN_BASE: u64 = 1_000_000_000;
/// Milligrin, a thousand of a grin
pub const MILLI_GRIN: u64 = GRIN_BASE / 1_000;
/// Microgrin, a thousand of a milligrin
pub const MICRO_GRIN: u64 = MILLI_GRIN / 1_000;
/// Nanogrin, smallest unit, takes a billion to make a grin
pub const NANO_GRIN: u64 = 1;

/// The block subsidy amount
pub const REWARD: u64 = 50 * GRIN_BASE;
hendi commented 6 years ago

Sorry for the long wait, this should be fixed now.