Skip to content

Transferable cd fee pool#55

Merged
ColinRitman merged 262 commits into
ColinRitman:masterfrom
usexfg:transferable-cd-fee-pool
Mar 31, 2026
Merged

Transferable cd fee pool#55
ColinRitman merged 262 commits into
ColinRitman:masterfrom
usexfg:transferable-cd-fee-pool

Conversation

@ColinRitman

Copy link
Copy Markdown
Owner

No description provided.

800k for maiden sync while debugging

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
of testnet-wallet-cli

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
limit- now max is 3x median size, at which coinbase reward becomes 0

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
(0.125%) fee on yield deposits, txn min fee is flat 8kh

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
to create_block_template' error at v10 upgrade height

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Updated TESTNET seed node configuration.
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
V11+: Replace digit-based decompose_amount_into_digits with
decompose_amount_uniform for miner coinbase outputs. Instead of
producing one output per decimal digit (e.g. 1×0.2 + 1×0.09 + 1×0.004),
produces multiple outputs at standard power-of-10 tiers
(e.g. 2×0.1 + 9×0.01 + 4×0.001). All coinbase outputs are now at
standard denominations, making them indistinguishable across blocks
in ring pools regardless of varying reward amounts from burns.

- Add decompose_amount_uniform() in CryptoNoteFormatUtils.h
- Gate on BLOCK_MAJOR_VERSION_11 in constructMinerTx
- Raise maxCoinbaseOuts from 11 to 33 for v11+ blocks
RPC query

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
commitmentOutputs pool of decoys (pre-image still visible, but w/max
obfuscation)

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
…rce abstraction

- SwapOfferRelay: P2P gossip service for swap offers (COMMAND_SWAP_OFFER/CANCEL/TRADE)
- SwapTerminal: ncurses TUI with candlestick charts, order book, trade tape
- Tier-locked swap amounts (0.8|8|80|800 XFG) matching deposit tiers
- Simple ratio selector: swap <tier> [pair] [1=best 2=market 3=fast]
- Composite pricing: weighted average across atomic swap TWAP + pluggable external sources
- PriceSource/PoolSourceConfig abstraction for HEAT/ETH pool, DEX, CEX drop-in
- Cross-pair NativeXfgPriceRange: triangulates USD-equivalent from all pairs
- 5 swap RPC endpoints: /getswapoffers /getswapprice /getswaptrades /submitswap /cancelswap
- /getswapprice returns source breakdown + cross-pair XFG/USD range
- Wallet callbacks wired: offer signing, cancel auth, composite rate fetch
- SwapDaemon (xfg-swap) skeleton with ETH/XMR/BCH counterparty chain clients
- Fixed circular static lib link order for Daemon/TestnetDaemon/PaymentGateService
…for maker

- Accept swap offer creates HTLC with random preimage + hash lock
- Taker locks XFG first (shorter timeout: 90 blocks mainnet, 12 testnet)
- Maker sees hash lock, mirrors it on counterparty chain
- Taker claims CTR (reveals preimage), maker claims XFG with revealed preimage
- Preimage + hash lock logged for user safekeeping
…r HTLC flow

ETH-side light client (xfg-eth-swap/):
- Go TUI with bubbletea/lipgloss for clean terminal interface
- Animated ETH diamond + fire splash screen
- Connects to EFier nodes via fuegod RPC (/getswapoffers, /getswapprice, /getswaptrades)
- Order book, trade history, price source breakdown tabs
- Cross-pair XFG/USD price range display
- accept <offer_id> command stub for HTLC lock flow
- CLI: --efier <url> for EFier node, --eth-rpc <url> for Ethereum endpoint

Wallet acceptOffer HTLC implementation:
- Taker generates random preimage, computes hashlock
- Creates HTLC locking XFG for maker's pubkey
- Shorter timeout on XFG side (90 blocks mainnet, 12 testnet)
- Logs preimage + hashlock for user safekeeping
…fire colors

XMR client (pair=0): Monero orange M circle logo + doom fire splash
BCH client (pair=2): BCH green ₿ circle logo + doom fire splash
ETH client: fire-colored diamond splash (was blue), mouse support, HTLC accept flow

All three share identical TUI: order book, trades, info tabs, accept/htlc/swap
commands, preimage generation (SHA-256 hashlock), and HTLC monitor scanning.
main thread & ncurse(tui) as bg thread

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
* add get_report[] & elderfier address flag, subaddress container fix,
ceremony auto-registering,

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>

* revert wrong branch push

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>

---------

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
…t field

Add new input type for CD ownership transfer without redeeming:
- TransactionInputCommitmentTransfer with newTerm field (tag 0x08)
- Add claimedInterest to TransactionInputCommitmentSpend for fee pool interest
- Serialization for both new/modified structs
…inal

Covers: Go TUI (bubbletea/lipgloss) with all-pairs view (ETH/HEAT/LUSD/XMR/BCH),
EFier-hosted read-only web UI, wallet integration via subprocess + RPC,
MetaMask bridge for Ethereum signing, tiered connection model.
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
SWAP_FEE_RATE_BPS=100 (1% of HTLC claim/refund amount)
FEE_POOL_RATE_PRECISION=1e6 fixed-point for epoch rate calc
CD_TRANSFER_MIN_REMAINING_TERM=1 for transferred CDs
- XMR pair deferred to v11 (requires adaptor signatures + DLEQ proofs)
- Fix testnet ports to p2p:20808 rpc:28280
- EFier web UI uses TradingView Lightweight Charts
- Dandelion++ remains v11 priority
14 tasks covering: project scaffold, styles, multi-pair RPC client,
candlestick bucketing, splash screen, layout engine, ticker bar,
orderbook, trade tape, chart renderer, command input, main TUI model.
- m_feePoolBalance, m_currentEpochSwapFees, m_totalCdLocked in Blockchain
- pushTransaction: accumulate 1% swap fee from HTLC claims/refunds
- pushTransaction: track CD locked supply, deduct claimedInterest
- pushTransaction: insert key images for CommitmentTransfer
- popTransaction: reverse all fee pool/supply operations
- BlockCacheSerializer: persist fee pool state to disk
- Public accessors: getFeePoolBalance(), getTotalCdLocked()
- Declare checkCommitmentTransferInput()
Solana's smart contract runtime supports native HTLCs via Programs,
avoiding the adaptor signature complexity that blocked XMR swaps.
Both Fuego and Solana use Ed25519 keys. SOL takes pair ID 0.

- Add Phantom bridge (same localhost pattern as MetaMask)
- Add sol-bridge.html, sol_bridge.go, sol_rpc.go to project structure
- 5 active pairs: ETH, SOL, BCH, HEAT, LUSD
- Hotkeys 1-5 for pair selection
- M3 now covers MetaMask + Phantom bridges
- M4 simplified to BCH only
…lidation, swap fee split

- CommitmentIndex: recordEpochFeeRate/getEpochFeeRate/getEpochCount + persistence
- Blockchain: compute per-epoch fee rate at epoch boundary, populate EpochReport
- Currency: calculateCdInterest() sums epoch rates over CD lock period
- Blockchain: checkCommitmentTransferInput() with ring sig, slashed guard, newTerm min
- Blockchain: CommitmentTransfer in checkTransactionInputs validation loop
- Currency/Blockchain: swap fee (1%) excluded from miner reward, goes to fee pool
- Config: epoch duration 1000 -> 900 blocks (5 days)
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
SOL,ETH,XMR compatibility, rm htlc txn struct from code, add new swapxfg
daemon, new EF fee of 0.1% PER EF instead of split, introduce fee pool
for CD on-chain apy per epoch, 80/10/10 CD/EF/Treasury, testnet reset 14

Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
Signed-off-by: aejontargaryen <aejontargaryen@protonmail.com>
@ColinRitman ColinRitman merged commit c5be042 into ColinRitman:master Mar 31, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants