Skip to content

A self contained, zero-dependency package to compute block rewards and supply for Bitcoin and Bitcoin-like chains

License

Notifications You must be signed in to change notification settings

RaghavSood/blockreward

Repository files navigation

blockreward

Go Reference

Convenience library to calculate block rewards for various bitcoin-like cryptocurrencies.

Usage

package main

import (
    "fmt"
    "github.com/RaghavSood/blockreward"
)

func main() {
    blockHeight := int64(210000)
    bitcoinReward := blockreward.SubsidyAtHeight(blockreward.BitcoinMainnet, blockHeight)
    litecoinReward := blockreward.SubsidyAtHeight(blockreward.LitecoinMainnet, blockHeight)

    fmt.Printf("Bitcoin reward at height %d: %d satoshis\n", blockHeight, bitcoinReward)
    fmt.Printf("Litecoin reward at height %d: %d satoshis\n", blockHeight, litecoinReward)
}

About

A self contained, zero-dependency package to compute block rewards and supply for Bitcoin and Bitcoin-like chains

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published