Physical Access Proof
Overview​
The Physical Access Proof demonstrates that storage providers have current physical access to capsule data at PlotCoin creation time. This prevents precomputation attacks where providers delete data but continue serving cached proofs.
Mechanism​
Chunk Selection Algorithm​
Storage providers must present 3 specific data chunks determined by blockchain randomness:
CHUNK_SIZE = 64 # 64 bytes per chunk
CHUNKS_REQUIRED = 3
CHUNK_WINDOW_SIZE = 1024 # First 1024 chunks
def select_required_chunks(block_hash, capsule_hash):
selector = sha256(block_hash + capsule_hash + b'DIG_FIXED_v1')
selected = []
for i in range(CHUNKS_REQUIRED):
# Deterministic selection within window
offset = int.from_bytes(selector[i*8:(i+1)*8], 'big')
chunk_index = offset % CHUNK_WINDOW_SIZE
selected.append(chunk_index)
return selected
Proof Structure​
interface PhysicalAccessProof {
// Blockchain anchor
blockHeight: uint32;
blockHash: bytes32;
// Selected chunk data
chunkIndices: uint32[3];
chunkData: bytes64[3];
chunkProofs: MerkleProof[3];
// Merkle roots
capsuleRootHash: bytes32;
plotId: bytes32;
capsuleHash: bytes32;
}
Generation​
Creation Process​
def generate_physical_access_proof(capsule_id, plot_id, current_block):
# Determine required chunks
required_chunks = select_required_chunks(current_block.hash, capsule_id)
# Extract chunk data
capsule_tree = load_capsule_merkle_tree(capsule_id)
chunk_data = []
chunk_proofs = []
for chunk_index in required_chunks:
if chunk_index < len(capsule_tree.chunks):
chunk_data.append(capsule_tree.chunks[chunk_index].data)
chunk_proofs.append(generate_merkle_proof(capsule_tree, chunk_index))
else:
# Handle small capsules
chunk_data.append(EMPTY_CHUNK)
chunk_proofs.append(EMPTY_PROOF)
return PhysicalAccessProof(
blockHeight=current_block.height,
blockHash=current_block.hash,
chunkIndices=required_chunks,
chunkData=chunk_data,
chunkProofs=chunk_proofs,
capsuleRootHash=capsule_tree.root_hash,
plotId=plot_id,
capsuleHash=capsule_id
)
Timing Requirements​
- Must use recent block (within MAX_BLOCK_AGE)
- Cannot use future blocks
- Typical window: 100-1000 blocks (~27 minutes - 4.4 hours)
Verification​
Validation Algorithm​
def verify_physical_access_proof(proof, expected_plot_id, expected_capsule_hash, current_epoch):
# Verify plot binding
if proof.plotId != expected_plot_id:
return False, "Plot ID mismatch"
if proof.capsuleHash != expected_capsule_hash:
return False, "Capsule hash mismatch"
# Verify temporal freshness
current_block = get_current_chia_block()
age = current_block.height - proof.blockHeight
if age > MAX_BLOCK_AGE:
return False, "Proof too old"
if age < 0:
return False, "Future block not allowed"
# Verify chunk selection
expected_chunks = select_required_chunks(proof.blockHash, proof.capsuleHash)
if proof.chunkIndices != expected_chunks:
return False, "Invalid chunk selection"
# Verify chunk merkle proofs
for i, chunk_index in enumerate(proof.chunkIndices):
if not verify_merkle_proof(
proof.chunkData[i],
proof.chunkProofs[i],
chunk_index, proof.capsuleRootHash):
return False, f"Invalid merkle proof for chunk {i}"
return True, "Valid physical access proof"
Attack Prevention​
Precomputation Attack​
Scenario:
- Provider generates proofs for capsule
- Deletes capsule to save storage
- Attempts to serve cached proofs
Prevention:
- Block hash unpredictable until mined
- Must have capsule data to extract chunks
- Different chunks required each time
Chunk Prediction​
Threat: Provider only stores likely chunks
Mitigation:
- 1024 possible chunks in window
- 3 chunks required = 1024³ combinations
- Storage overhead makes selective storage uneconomical
Time-based Attacks​
Controls:
- Strict block age requirements
- Forward-time prevention
- Blockchain-anchored timing
Parameters​
Security Constants​
# Core parameters
CHUNK_SIZE = 64 # 64 bytes per chunk
CHUNKS_REQUIRED = 3 # 3 chunks for verification
CHUNK_WINDOW_SIZE = 1024 # First 1024 chunks
MAX_BLOCK_AGE = 1000 # ~4.4 hours at 16s blocks
# Security levels
MIN_CHUNK_ENTROPY = 30 # Bits of selection entropy
COLLISION_RESISTANCE = 2**128 # Merkle tree security
Design Rationale​
Parameter | Value | Justification |
---|---|---|
Chunk Size | 64 bytes | Balance between granularity and overhead |
Chunks Required | 3 | Statistical confidence with minimal data exposure |
Selection Window | 1024 chunks | 65KB window covers small files |
Block Age | 1000 blocks | Fresh without excessive updates |
Integration​
In Proof Package​
The physical access proof integrates with other proofs:
def create_complete_proof_package(plot, capsule_id, current_block):
return ProofPackage(
plotOwnership=generate_plot_ownership_proof(plot),
dataInclusion=generate_data_inclusion_proof(plot, capsule_id),
computationalWork=generate_work_proof(plot, capsule_id),
physicalAccess=generate_physical_access_proof(
capsule_id, plot.id, current_block
)
)
Proof Dependencies​
1. Plot Ownership → Plot ID verified
2. Data Inclusion → Capsule exists in plot
3. Computational Work → Work performed for capsule
4. Physical Access → Current access to capsule data
Compression​
def compress_physical_access_proof(proof):
return {
'blockRef': proof.blockHeight, # Height cheaper than hash
'chunks': [
(idx, data[:16]) # First 16 bytes only
for idx, data in zip(proof.chunkIndices, proof.chunkData)
],
'capsuleHash': capsule_hash,
'signature': sign_proof(proof)
}
Parameters Table​
Parameter | Value | Description |
---|---|---|
CHUNK_SIZE | 64 bytes | Individual chunk size |
CHUNKS_REQUIRED | 3 | Number of chunks to verify |
CHUNK_WINDOW_SIZE | 1024 | Balance between coverage and small capsule support |
MAX_BLOCK_AGE | 1000 blocks | Maximum proof age (~4.4 hours) |
MIN_ENTROPY | 30 bits | Minimum selection randomness |
Summary​
The Physical Access Proof ensures storage providers maintain actual data possession through blockchain-anchored chunk challenges. By requiring specific data chunks determined by unpredictable blockchain randomness, the system prevents providers from deleting data while continuing to claim storage. This temporal verification complements the other three proofs to create a complete storage verification system.