[go: up one dir, main page]

Add Mining Fields to KeyPage Schema

Summary

Extend the KeyPage schema to support mining-specific configuration fields.

Background

For third-party app mining support, we need to store mining difficulty and expiry information directly in KeyPage entries. This allows apps to set custom difficulty per miner and manage mining permissions.

Requirements

  • Add MiningDifficulty field (optional [32]byte) to KeyPageEntry
  • Add MiningExpiry field (optional uint64) to KeyPageEntry
  • Ensure backward compatibility with existing KeyPages
  • Update binary marshaling/unmarshaling

Implementation Details

type KeyPageEntry struct {
    // Existing fields...
    PublicKeyHash  []byte
    Owner          *url.URL
    Delegate       *url.URL
    
    // NEW: Optional mining configuration
    MiningDifficulty *[32]byte  // nil if not a mining keypage
    MiningExpiry     *uint64    // Optional: when mining permission expires
}

Acceptance Criteria

  • Schema updated in protocol/accounts.yml
  • Generated code updated via make generate
  • Migration path for existing KeyPages defined
  • Unit tests for new fields
  • Binary compatibility tests pass

Dependencies

  • Depends on: #3665 (Launch Site Creation)

Related

  • Epic: &37
  • Specification: 32-lxr-mining.md