-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Currently the FAT spec has some differences than the code as to what ends up on chain in an OPR. From the OPR struct in #134:
// OraclePriceRecord is the data used and created by miners
type OraclePriceRecord struct {
// These fields are not part of the OPR, but track values associated with the OPR.
Config *config.Config `json:"-"` // The config of the miner using the record
Difficulty uint64 `json:"-"` // The difficulty of the given nonce
Grade float64 `json:"-"` // The grade when OPR records are compared
OPRHash []byte `json:"-"` // The hash of the OPR record (used by PegNet Mining)
Entry *factom.Entry `json:"-"` // Entry to record this record
// These values define the context of the OPR, and they go into the PegNet OPR record, and are mined.
OPRChainID string `json:"oprchainid"` // [base58] Chain ID of the chain used by the Oracle Miners
Dbht int32 `json:"dbht"` // The Directory Block Height of the OPR.
WinPreviousOPR [10]string `json:"winners"` // First 8 bytes of the Entry Hashes of the previous winners
CoinbasePNTAddress string `json:"coinbase"` // [base58] PNT Address to pay PNT
FactomDigitalID string `json:"FactomDigitalID"` // [unicode] Digital Identity of the miner
// The Oracle values of the OPR, they are the meat of the OPR record, and are mined.
Assets OraclePriceRecordAssetList `json:"assets"`
}
The latest version of the OPR in the Pegnet FAT Spec (Factom-Asset-Tokens/FAT#25):
{
"winners": [
"ba98d1bc839877a6",
...
],
"reward": "FA...",
"identity": [
"Minder",
"Bob",
"99"
],
"rates": {
"PNT": 0,
...
}
}
The serialized values of the OPR datastructure vary subtly from the current spec and should be synced up.
There was a short discussion about OPRChainID somewhere, and I believe it was omitted from the OPR as Pegnet's POW and structure effectively de-incentivizes replay onto other chains(networks) by incentivizing players to only use their hashpower on the mainnet (Real PNT rewards). I can't think of why someone would want to replay mainnet OPRs onto the testnet.
Today during our call we briefly discussed dbht being readded to the spec, and that will be reflected soon 👍
If there is anything else that should be either added to the spec that is required by the implementation,or vice versa let's please discuss!