Skip to content

Instantly share code, notes, and snippets.

View kushti's full-sized avatar

Alexander Chepurnoy kushti

View GitHub Profile
ergo {
directory = "/var/pool/ergo/mainnet"
networkType = "mainnet"
node {
mining = true
}
chain {
reemission {
checkReemissionRules = true
}
## Anomalies found and explained
### A. Post-block "invalid tx" bursts (benign race, very frequent)
When block N is applied, its transactions remain in the mempool for a few milliseconds.
`CandidateGenerator` (running on `ef-critical-dispatcher`) races ahead of mempool cleanup
(`ErgoMemPool` invalidation/removal on another thread), so `collectTxs` flags the just-mined
transactions as "double-spending or spending non-existing inputs"
(`src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala:897`).
12:53:40.598 ERROR [ef-critical-dispatcher-17] o.e.m.m.ErgoTransaction - EIP-27 check failed due to requirement failed: outputs contain reemission token :
java.lang.IllegalArgumentException: requirement failed: outputs contain reemission token
at scala.Predef$.require(Predef.scala:281)
at org.ergoplatform.modifiers.mempool.ErgoTransaction.$anonfun$verifyReemissionSpending$14(ErgoTransaction.scala:319)
at org.ergoplatform.modifiers.mempool.ErgoTransaction.$anonfun$verifyReemissionSpending$14$adapted(ErgoTransaction.scala:318)
at scala.collection.TraversableLike.$anonfun$filterImpl$1(TraversableLike.scala:304)
at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:38)
at scala.collection.TraversableLike.filterImpl(TraversableLike.scala:303)
14:25:00.511 INFO [f-critical-dispatcher-541] o.e.m.CandidateGenerator$ - Got candidate block at height 1833224 with 11 transactions, msg c111a9414008fc319efaa2e9d3e69a1aac341252bd2c185471e78b99bc28abff
14:26:14.033 DEBUG [f-critical-dispatcher-540] o.e.m.CandidateGenerator - Regenerating candidate block
14:26:17.642 INFO [f-critical-dispatcher-540] o.e.m.CandidateGenerator$ - Got candidate block at height 1833224 with 20 transactions, msg b992c870e62b656079391035a524e17546cb6ec1cf4911b9f02c9193a7669eda
14:26:52.949 INFO [f-critical-dispatcher-540] o.e.m.CandidateGenerator$ - Got candidate block at height 1833225 with 3 transactions, msg 6bfb2e0a132f614dbca416c8bf02c9a5adbe7e2fa8a3076c4724d5839eb43477
14:27:58.866 DEBUG [f-critical-dispatcher-551] o.e.m.CandidateGenerator - Regenerating candidate block
14:28:01.358 INFO [f-critical-dispatcher-551] o.e.m.CandidateGenerator$ - Got candidate block at height 1833225 with 6 transactions, msg 527530b5cee7188091ae4bc23c4887e4c7e7d7b451832f731f0c3d7c3e6c709e
14:2
09:21:19.388 INFO [ref-critical-dispatcher-6] o.e.m.CandidateGenerator$ - Got candidate block at height 1833073 with 1 transactions, msg d512b327e7249a113be5c86e6607a732b4954a978f3901e7a787a1e4ba1480b2
09:23:25.663 INFO [ef-critical-dispatcher-60] o.e.m.CandidateGenerator$ - Got candidate block at height 1833074 with 11 transactions, msg ce8617cea7fa0e38c07a506b2d0c0f3c37ac77d3bb1c766fab37a94896d3bf9a
09:25:47.971 INFO [ref-critical-dispatcher-6] o.e.m.CandidateGenerator$ - Got candidate block at height 1833074 with 12 transactions, msg a742846e92cd295b97879ef65ed102d0ebe5c0bb39472e4ee5ffd50495ebea1f
09:26:07.882 INFO [ref-critical-dispatcher-6] o.e.m.CandidateGenerator$ - Got candidate block at height 1833075 with 11 transactions, msg 8409a8ff5af9892329c83bce4b41f579d5b230a76a0d807a2fd8ca134ecf5464
09:27:23.193 INFO [ref-critical-dispatcher-6] o.e.m.CandidateGenerator$ - Got candidate block at height 1833076 with 6 transactions, msg 2664ef2b427b0b539c917efa9cc5ca56febe4edf45fbc0399ab5baf950e06e0c
09:28:
# NiPoPoW (Non-Interactive Proofs of Proof-of-Work) Verification Specification
## Overview
This document specifies the NiPoPoW (Non-Interactive Proofs of Proof-of-Work) verification operations available in the Ergo blockchain protocol. NiPoPoW enables lightweight clients to verify blockchain properties without downloading the entire chain, using compact proofs that summarize the chain's history.
## Background
NiPoPoW is based on academic research:
- **KMZ17**: Financial Cryptography 2020 paper on Non-Interactive Proofs of Proof-of-Work
Local Credit, Global Settlement: Enhancing Trust-Based Credit Creation with On-Chain Reserve Contracts
======================================================================================================
In this work, we propose Basis, a framework where both local IOU trust-based currencies as well as
global ones using blockchain smart contract powered reserves where there is no trust (possibly connecting local trading
circles) can coexist. Coordination with blockchain is needed only during debt note redemption against a reserve contract.
Payments are done offchain, so with low fees and no need to use low-security centralized blockchain-like systems with
high throughput. For coordination and transparency of debt in the system, a tracker service is used, which can not steal money
from reserves. We provide analysis of trust-minimization in regards with tracker activities.
{
// Contract for on-chain reserve (in ERG only for now) backing offchain payments
// aka Basis
// https://www.ergoforum.org/t/basis-a-foundational-on-chain-reserve-approach-to-support-a-variety-of-offchain-protocols/5153
// Main use-cases:
// * digital payments with credit creation allowed
// * especially with areas with no stable Inernet connection (over mesh networks)
// * agent-to-agent payments
// * payments for content (such as 402 HTTP code processing)
// oracle related tokens
// take token IDs below from oracle pool UI
// DORT
val gort = "ae399fcb751e8e247d0da8179a2bcca2aa5119fff9c85721ffab9cdc9a3cb2dd"
// USD oracle pool data
val oracleTokenId = "74fa4aee3607ceb7bdefd51a856861b5dbfa434a8f6c93bfe967de8ed1a30a78"
val oraclePoolNFT = "6a2b821b5727e85beb5e78b4efb9f0250d59cd48481d2ded2c23e91ba1d07c66"