Skip to main content

WitnessCoin

💜 Support the DIG Network

Help build the future of decentralized storage! The DIG Network is an open-source project that needs community support to continue development.

💜 Support the Project → - Donate crypto, buy NFTs, or sponsor development

Overview​

WitnessCoin is an on-chain validation proof that demonstrates a Witness Miner has successfully verified a DIG Node's availability and content serving capability. Each WitnessCoin serves as an immutable record of validation, enabling reward distribution while maintaining network integrity through staking requirements.

Technical Specification​

Coin Structure​

struct WitnessCoin {
// Identifiers
bytes32 witnessId; // Witness miner public key
bytes32 digNodePublicKey; // Validated DIG node ID
bytes32 plotCoinId; // Target PlotCoin validated

// Validation proofs
PhysicalAccessProof accessProof; // Proves current data access
OwnershipProof ownershipProof; // Proves plot ownership
InclusionProof inclusionProof; // Proves data inclusion

// Entropy proof (deterministic selection)
EntropyProof entropyProof; // Proves correct target selection
uint32 blockHeight; // Entropy source block
bytes32 blockHash; // Entropy source hash

// Economic binding
uint256 stakeAmount; // DIG tokens staked (min TBD)
uint256 stakeUnlockTime; // 7-day lockup period

// Metadata
uint256 validationTimestamp; // When validation occurred
uint32 epoch; // Reward epoch number
bytes witnessSignature; // Witness authorization
}

Entropy-Based Selection​

WitnessCoins include proof of deterministic selection:

EntropyProof {
witnessPublicKey: bytes32;
blockHash: bytes32; // Every 38th block
witnessEntropy: bytes32; // SHA256(blockHash + publicKey)
targetPlotCoin: bytes32; // Selected target
selectionPath: bytes; // Proof of deterministic selection
}

Validation Flow​

Creation Process​

Witness Miner Selection:
Block Height % 38 == 0 → Valid Entropy Block
↓
SHA256(blockHash + witnessKey) → Witness Entropy
↓
Deterministic Target Selection → PlotCoin Target
↓
Request Proofs from DIG Node → Validation
↓
Create WitnessCoin → On-chain Submission

Proof Requirements​

1. Physical Access Proof

  • Current block-anchored challenge
  • 3 random chunk selections
  • Response within time window
  • Cryptographic binding to entropy

2. Ownership Proof

  • Valid BLS signature
  • Matches PlotCoin registration
  • Public key verification

3. Inclusion Proof

  • Merkle path verification
  • Capsule exists in plot
  • Root hash validation

Economic Model​

Staking Requirements​

WITNESS_STAKE = {
"minimum": "TBD", # DIG tokens
"lockup_period": 604800, # 7 days in seconds
"slashing_rate": "TBD", # TBD for violations
"unbonding_period": 259200 # 3 days
}

Reward Distribution​

WitnessCoins enable two-party rewards:

Epoch N Validations → Epoch N+1 Rewards

Total Reward Pool
├── TBD → Witness Miners (validators)
└── TBD → DIG Nodes (validated storage)

Example Distribution:

def calculate_rewards(witness_coins, reward_pool):
successful_validations = filter(lambda c: c.valid, witness_coins)

witness_share = reward_pool * WITNESS_SHARE_RATE # TBD
dig_share = reward_pool * DIG_SHARE_RATE # TBD

per_validation_witness = witness_share / len(successful_validations)
per_validation_dig = dig_share / len(successful_validations)

return {
"witness_rewards": per_validation_witness,
"dig_rewards": per_validation_dig
}

Security Features​

Sybil Resistance​

  • Stake Requirement: TBD DIG minimum prevents cheap attacks
  • Rate Limiting: Maximum 6 validations per hour per witness
  • Entropy Binding: Can't choose validation targets
  • Lockup Period: 7-day stake lock prevents hit-and-run

Fraud Prevention​

def verify_witness_coin(coin):
# 1. Verify stake commitment
if coin.stakeAmount < MINIMUM_STAKE:
return INVALID_STAKE

# 2. Verify entropy proof
expected_entropy = sha256(coin.blockHash + coin.witnessId)
if coin.entropyProof.witnessEntropy != expected_entropy:
return INVALID_ENTROPY

# 3. Verify target selection
if not verify_deterministic_selection(coin.entropyProof):
return INVALID_SELECTION

# 4. Verify all three proofs
if not verify_proofs(coin.accessProof, coin.ownershipProof, coin.inclusionProof):
return INVALID_PROOFS

# 5. Verify timing constraints
if coin.validationTimestamp > coin.blockHeight + MAX_VALIDATION_DELAY:
return STALE_VALIDATION

return VALID

Slashing Conditions​

Witnesses lose stake for:

  • False validation claims
  • Selective validation (censorship)
  • Entropy manipulation attempts
  • Collusion with DIG nodes

Lifecycle Management​

Creation Timeline​

T+0:   Entropy block appears (height % 38 == 0)
T+30s: Witness selects target deterministically
T+60s: Validation request sent to DIG node
T+90s: Proofs received and verified
T+120s: WitnessCoin created on-chain
T+1 epoch: Rewards distributed

Expiration​

WitnessCoins are permanent records but only eligible for rewards in their designated epoch:

def is_reward_eligible(witness_coin, current_epoch):
return witness_coin.epoch == current_epoch - 1 # Lag by one epoch

Query Interface​

Discovery Methods​

class WitnessCoinRegistry:
def query_by_witness(self, witness_id: bytes32) -> List[WitnessCoin]:
"""Returns all validations by a witness"""

def query_by_dig_node(self, dig_node_id: bytes32) -> List[WitnessCoin]:
"""Returns all validations of a DIG node"""

def query_by_epoch(self, epoch: uint32) -> List[WitnessCoin]:
"""Returns all validations in an epoch"""

def verify_validation(self, coin: WitnessCoin) -> ValidationStatus:
"""Comprehensive validation verification"""

Integration Points​

With Witness Miners​

# Witness miner creates WitnessCoin after validation
witness_coin = WitnessCoin(
witness_id=self.public_key,
dig_node_id=validation_result.node_id,
proofs=validation_result.proofs,
entropy_proof=self.generate_entropy_proof(),
stake_amount=self.staked_amount
)

With Reward System​

# Validators use WitnessCoins for distribution
def distribute_epoch_rewards(epoch):
witness_coins = registry.query_by_epoch(epoch - 1)
valid_coins = filter(verify_witness_coin, witness_coins)

for coin in valid_coins:
reward_witness(coin.witnessId, witness_reward)
reward_dig_node(coin.digNodeId, dig_reward)

With DIG Nodes​

DIG nodes must respond to witness validation requests:

  • Provide three proofs on demand
  • Response within 30-second window
  • Cryptographic binding to challenge

Performance Characteristics​

  • Creation Cost: ~0.001 XCH in fees (market dependent)
  • Verification Time: ~10ms per coin
  • Query Complexity: O(1) by witness/node/epoch
  • Storage Size: ~1KB per coin
  • Stake Lock: TBD DIG for 7 days

Attack Analysis​

Prevented Attacks​

AttackPrevention
Sybil witnessesTBD DIG stake requirement
Selective targetingDeterministic entropy selection
False validationsSlashing penalties
Validation spamRate limiting (6/hour)
CollusionUnpredictable target selection
Free ridingStake lock prevents quick exit

Economic Security​

With DIG at $X:

  • Witness stake cost: TBD
  • Maximum hourly validations: 6
  • Break-even time: TBD
  • Slashing risk: TBD

Future Enhancements​

  • Reputation System: Weight rewards by witness performance
  • Dynamic Stakes: Adjust requirements based on network size
  • Batch Validation: Multiple validations per coin
  • Cross-chain Support: Validate storage on other chains

Summary​

WitnessCoin provides a secure, stake-based mechanism for validating DIG node availability while preventing sybil attacks and ensuring fair reward distribution. Through entropy-based selection and comprehensive proof requirements, the system maintains network integrity while incentivizing both witnesses and storage providers.