Implement conversion from Long-encoded nBits representation to BigInt and back #675
Labels
A-consensus
Area: Code used in consensus (i.e. transaction validation)
Bounty - 200 SigUSD
C-feature
Category: Feature request or PR
P2-medium
Priority: Medium
soft-fork
Implementation requires soft-fork
Milestone
For trustless mining derivatives (see e.g. this proposal https://www.ergoforum.org/t/mining-power-derivatives-two-tokens-approach/277 ) it could be good to have difficulty encoded as a big integer, but currently it is represented in nBits format (as Long value) in the context, which is not suitable for comparisons.
Thus it would be reasonable to implement fromNBits operation, converting nBits in Long value to BigInt.
nBits encoding implementation and corresponding test vectors can be found in the Ergo node codebase.
The text was updated successfully, but these errors were encountered: