Defending PegNet Oracle Data

PIP 10, 12, 13, 14 & 15 Addressing Front Running, Bad Miners, & API Errors

David A. Johnston
PegNet
3 min readApr 28, 2020

--

TL;DR

In order to defend the integrity of PegNet’s Oracle Price Records (OPRs) five improvements are proposed PIP 10, 12, 13, 14, & 15.
First averaging the price of low value tokens over many blocks when calculating their conversions. This is already coded up in PIP 10.
Second by adding a Staking Reward for pAsset holders to encourage arbitragers to buy cheap pAsset off the exchange.
Third by adding Staking as a source of price records and reward Stakers for this function PIP 13.
Forth calculate any divergence between the Miners and Stakers OPRs and pause conversions when a divergence is detected, this is PIP 14.
Fifth, detect and pause conversions when extreme increases or decreases take place as a final measure of protection against API errors or colluding Miners / Stakers PIP 15.

1. Protection From Front Runners — PIP 10

Implement a modified PIP 10 applied ONLY for pFCT and PEG tokens conversions (PegNet’s highest risk tokens). Adding enough weight (144 blocks) to the averaging equation, so someone trying to front run the price of either pFCT or PEG has to really hold the market up or down for a while (1 day) to effect pFCT or PEG conversion prices.

2. Implement Staking for all pAsset Holders To Encourage Arbitrage

Create a 5,000 PEG per block reward for arbitragers via a Staking reward for those holding pAssets.

3. Protection Against Bad Miner Oracle Price Records — PIP 13

Implement PIP 13 for Stakers to get rewarded for reporting oracles prices (random 25 pAsset addresses selected pro-rata based on their pAsset balances for rewards and to pull oracle price rewards from each block.

Random selection each block will make it tough to for an attacker to game.

Hashpower of White Hat Miner

4. Divergences As A Trigger For Conversion Pauses — PIP 14

Calculate divergences (as suggested by white hat miner) over 0.5% between miners 50% weight and pAsset Stakers oracle price records 50% weight and pause conversions for affected pAssets or PEG. Full text of PIP 14.

5. Protection From API Errors — PIP 15

The PegNet software Detect and block conversions when there is a large move from API price reporting. This can happen when errors are reported by honest miners / Stakers all using bad data.
Suggested parameters for all pAssets / PEG.
Price: 50% reduction or 100% increase block over block.

Summary

This combination of modified PIPs give PegNet both fine grain protection against front runners moving market prices, against miner attacks, and against spikes from API errors.

--

--

David A. Johnston
PegNet

Technologist, Voluntarist, Future Martian Settler, & Evangelist for Decentralization.