Chapter 4
Waste Tracking API & Data Standards
This chapter provides comprehensive coverage of the WIA-ENE-022 API specifications, blockchain-based chain-of-custody verification, standardized data formats for inter-municipal exchange, and integration protocols that enable seamless interoperability across heterogeneous waste management systems worldwide.
弘益人間 · Benefit All Humanity
Open standards and transparent data enable global collaboration in solving humanity's waste challenges
1. WIA-ENE-022 API Specification
The WIA-ENE-022 API standard defines RESTful endpoints, GraphQL queries, and WebSocket streams for real-time waste management data exchange. The specification has been adopted by 47 countries, 1,200+ municipalities, and serves as the foundation for ISO/IEC 30147 waste management data interchange standard currently under development.
1.1 Core API Endpoints
The API specification organizes functionality into six primary resource domains with over 120 documented endpoints:
| Resource Domain |
Endpoints |
Primary Use Cases |
Authentication |
| /bins |
18 endpoints |
Container registration, status queries, fill-level updates |
API Key + OAuth 2.0 |
| /collections |
22 endpoints |
Collection events, route management, vehicle tracking |
OAuth 2.0 + JWT |
| /materials |
15 endpoints |
Material classification, recovery rates, market pricing |
API Key |
| /facilities |
20 endpoints |
MRF operations, processing capacity, quality metrics |
OAuth 2.0 + mTLS |
| /analytics |
28 endpoints |
Performance dashboards, predictive models, reporting |
OAuth 2.0 |
| /blockchain |
12 endpoints |
Chain-of-custody verification, audit trails, compliance |
Multi-sig + Hardware Security Module |
1.2 RESTful API Implementation
// WIA-ENE-022 TypeScript SDK - Bin Management
import { WIAWasteClient } from '@wia/ene-022';
interface WIAWasteConfig {
baseURL: string;
apiKey: string;
version: 'v1' | 'v2';
timeout?: number;
retries?: number;
}
class WIAWasteAPI {
private client: WIAWasteClient;
constructor(config: WIAWasteConfig) {
this.client = new WIAWasteClient({
baseURL: config.baseURL || 'https://api.wia.org/ene-022',
apiKey: config.apiKey,
version: config.version || 'v1',
timeout: config.timeout || 30000,
retries: config.retries || 3
});
}
// Create new bin registration
async registerBin(binData: BinRegistration): Promise
{
const response = await this.client.post('/bins', {
containerId: binData.containerId,
location: {
latitude: binData.latitude,
longitude: binData.longitude,
address: binData.address,
municipality: binData.municipality
},
specifications: {
capacity: binData.capacity, // liters
material: binData.material, // plastic, metal
wasteStream: binData.wasteStream, // recyclables, organic, etc.
manufacturer: binData.manufacturer,
installDate: binData.installDate
},
sensors: {
fillLevel: {
type: 'ultrasonic',
model: binData.sensorModel,
lastCalibration: binData.lastCalibration
},
communication: {
protocol: binData.protocol, // LoRaWAN, NB-IoT
deviceEUI: binData.deviceEUI,
appKey: binData.appKey
}
},
metadata: {
tags: binData.tags,
customFields: binData.customFields
}
});
return response.data;
}
// Update bin fill level
async updateFillLevel(
containerId: string,
fillData: FillLevelUpdate
): Promise {
return await this.client.put(`/bins/${containerId}/fill-level`, {
percentage: fillData.percentage,
timestamp: fillData.timestamp || new Date().toISOString(),
confidence: fillData.confidence || 0.95,
temperature: fillData.temperature,
weight: fillData.weight,
sensorHealth: {
batteryLevel: fillData.batteryLevel,
signalStrength: fillData.signalStrength,
lastMaintenance: fillData.lastMaintenance
}
});
}
// Query bins requiring collection
async getCollectionQueue(params: CollectionQueryParams): Promise {
const response = await this.client.get('/bins/collection-queue', {
params: {
municipality: params.municipality,
wasteStream: params.wasteStream,
minFillLevel: params.minFillLevel || 80,
maxDistance: params.maxDistance, // meters from depot
urgency: params.urgency, // high, medium, low
limit: params.limit || 100,
offset: params.offset || 0
}
});
return response.data.bins;
}
// Record collection event
async recordCollection(
containerId: string,
event: CollectionEvent
): Promise {
return await this.client.post(`/bins/${containerId}/collections`, {
timestamp: event.timestamp,
vehicleId: event.vehicleId,
driver: event.driver,
route: event.routeId,
weight: {
collected: event.weightCollected, // kg
unit: 'kg',
accuracy: event.weightAccuracy
},
quality: {
contamination: event.contamination, // 0-100 score
notes: event.notes
},
location: {
latitude: event.latitude,
longitude: event.longitude,
accuracy: event.gpsAccuracy
},
verification: {
photo: event.photoUrl,
signature: event.driverSignature,
timestamp: event.timestamp
}
});
}
// GraphQL query for complex analytics
async queryAnalytics(query: string, variables?: any): Promise {
const response = await this.client.post('/graphql', {
query: query,
variables: variables
});
return response.data.data;
}
}
// Example usage
const wiaAPI = new WIAWasteAPI({
baseURL: 'https://api.wia.org/ene-022',
apiKey: process.env.WIA_API_KEY!,
version: 'v1'
});
// Register a new smart bin
const bin = await wiaAPI.registerBin({
containerId: 'BIN-NYC-001-4523',
latitude: 40.7128,
longitude: -74.0060,
address: '123 Main St, New York, NY 10001',
municipality: 'NYC-Manhattan',
capacity: 240,
material: 'HDPE',
wasteStream: 'recyclables_mixed',
manufacturer: 'SmartBin Inc.',
installDate: '2025-01-15',
sensorModel: 'UltraSonic-X500',
protocol: 'LoRaWAN',
deviceEUI: '0004A30B001A2B3C',
appKey: 'ABCDEF1234567890ABCDEF1234567890'
});
2. Blockchain Chain-of-Custody
WIA-ENE-022 integrates blockchain technology to provide immutable audit trails for waste transfers, material provenance verification, and compliance documentation. The standard supports Hyperledger Fabric, Ethereum, and Polygon networks, with 35+ operational implementations managing $1.2B in annual material flows.
2.1 Blockchain Architecture
| Component |
Technology |
Function |
Performance |
| Smart Contracts |
Solidity, Chaincode (Go) |
Automated custody transfers, SLA verification |
500-2000 TPS |
| Consensus |
Proof of Authority (PoA) |
Transaction validation, block finality |
2-5 sec finality |
| Data Storage |
IPFS, Arweave |
Distributed storage for sensor data, photos |
$0.01/GB/year |
| Identity |
DID, Verifiable Credentials |
Entity authentication, authorization |
Sub-second resolution |
| Integration Layer |
Chainlink Oracles |
Off-chain data feeds, sensor integration |
15-30 sec latency |
// Blockchain Waste Tracking Smart Contract
pragma solidity ^0.8.19;
contract WasteChainOfCustody {
struct WasteTransfer {
string transferId;
address from;
address to;
uint256 timestamp;
string wasteType;
uint256 quantity; // kg
string location; // GPS coordinates
string verificationHash; // IPFS hash of supporting docs
TransferStatus status;
string[] witnessSignatures;
}
enum TransferStatus { Initiated, InTransit, Delivered, Verified, Disputed }
mapping(string => WasteTransfer) public transfers;
mapping(address => bool) public authorizedParties;
mapping(string => string[]) public chainOfCustody; // wasteBatchId => transferIds
event TransferInitiated(string indexed transferId, address from, address to);
event TransferCompleted(string indexed transferId, uint256 timestamp);
event TransferVerified(string indexed transferId, address verifier);
modifier onlyAuthorized() {
require(authorizedParties[msg.sender], "Not authorized");
_;
}
function initiateTransfer(
string memory transferId,
address to,
string memory wasteType,
uint256 quantity,
string memory location,
string memory verificationHash
) public onlyAuthorized returns (bool) {
require(transfers[transferId].timestamp == 0, "Transfer ID exists");
transfers[transferId] = WasteTransfer({
transferId: transferId,
from: msg.sender,
to: to,
timestamp: block.timestamp,
wasteType: wasteType,
quantity: quantity,
location: location,
verificationHash: verificationHash,
status: TransferStatus.Initiated,
witnessSignatures: new string[](0)
});
emit TransferInitiated(transferId, msg.sender, to);
return true;
}
function updateTransferStatus(
string memory transferId,
TransferStatus newStatus,
string memory witnessSignature
) public onlyAuthorized returns (bool) {
WasteTransfer storage transfer = transfers[transferId];
require(transfer.timestamp > 0, "Transfer not found");
require(
msg.sender == transfer.from || msg.sender == transfer.to,
"Not party to transfer"
);
transfer.status = newStatus;
transfer.witnessSignatures.push(witnessSignature);
if (newStatus == TransferStatus.Verified) {
emit TransferVerified(transferId, msg.sender);
}
return true;
}
function getChainOfCustody(
string memory wasteBatchId
) public view returns (string[] memory) {
return chainOfCustody[wasteBatchId];
}
function verifyIntegrity(
string memory transferId,
string memory expectedHash
) public view returns (bool) {
return keccak256(abi.encodePacked(transfers[transferId].verificationHash))
== keccak256(abi.encodePacked(expectedHash));
}
}
// TypeScript integration
import { ethers } from 'ethers';
class BlockchainWasteTracker {
private contract: ethers.Contract;
private provider: ethers.providers.Provider;
async recordWasteTransfer(
transferData: WasteTransferData
): Promise {
// Upload supporting documents to IPFS
const ipfsHash = await this.uploadToIPFS({
photos: transferData.photos,
manifest: transferData.manifest,
certificates: transferData.certificates
});
// Create blockchain transaction
const tx = await this.contract.initiateTransfer(
transferData.transferId,
transferData.recipient,
transferData.wasteType,
transferData.quantity,
`${transferData.latitude},${transferData.longitude}`,
ipfsHash
);
// Wait for confirmation
const receipt = await tx.wait(2); // 2 block confirmations
return receipt.transactionHash;
}
async verifyChainOfCustody(
wasteBatchId: string
): Promise {
// Retrieve full custody chain from blockchain
const transfers = await this.contract.getChainOfCustody(wasteBatchId);
// Verify each transfer's integrity
const verified = await Promise.all(
transfers.map(async (transferId: string) => {
const transfer = await this.contract.transfers(transferId);
const ipfsData = await this.retrieveFromIPFS(transfer.verificationHash);
return this.validateTransfer(transfer, ipfsData);
})
);
return {
wasteBatchId,
totalTransfers: transfers.length,
allVerified: verified.every(v => v === true),
timeline: await this.buildTimeline(transfers),
participants: await this.extractParticipants(transfers)
};
}
}
3. Data Exchange Formats
WIA-ENE-022 defines standardized data schemas using JSON Schema, Protocol Buffers, and Apache Avro to ensure interoperability across diverse systems. These formats support real-time streaming, batch transfers, and historical archival with backward compatibility guarantees.
3.1 Standard Data Schemas
// WIA-ENE-022 Standard Data Formats
// 1. Waste Collection Event (JSON Schema)
interface WasteCollectionEvent {
// Event identification
eventId: string; // UUID v4
eventType: 'collection' | 'transfer' | 'processing' | 'disposal';
timestamp: string; // ISO 8601 UTC
version: string; // Schema version (e.g., "1.2.0")
// Location data
location: {
type: 'Point';
coordinates: [number, number]; // [longitude, latitude] GeoJSON
altitude?: number; // meters above sea level
accuracy: number; // GPS accuracy in meters
address?: {
street: string;
city: string;
state: string;
postalCode: string;
country: string; // ISO 3166-1 alpha-2
};
};
// Container information
container: {
id: string; // Unique container ID
type: string; // bin, dumpster, compactor
capacity: number; // liters
fillLevel: {
percentage: number; // 0-100
measurement: {
method: 'ultrasonic' | 'weight' | 'visual';
confidence: number; // 0-1
raw: number; // sensor raw value
unit: string; // cm, kg, etc.
};
};
wasteStream: WasteStreamCode;
rfid?: string;
};
// Waste characteristics
waste: {
type: WasteStreamCode;
quantity: {
weight: number; // kilograms
volume: number; // cubic meters
estimationMethod: 'measured' | 'estimated' | 'declared';
};
composition?: MaterialComposition[];
contamination: {
score: number; // 0-100 (0=pure, 100=highly contaminated)
contaminants?: string[];
};
properties?: {
moisture?: number; // percentage
density?: number; // kg/m³
temperature?: number; // Celsius
hazardous: boolean;
classification?: string; // Basel Convention codes
};
};
// Collection details
collection: {
vehicleId: string;
driver: {
id: string;
name: string;
certification?: string[];
};
route: {
id: string;
sequence: number;
scheduledTime?: string;
actualTime: string;
};
duration: number; // seconds
fuelConsumed?: number; // liters
};
// Destination
destination?: {
facilityId: string;
facilityType: 'MRF' | 'Landfill' | 'WTE' | 'Composting' | 'Transfer';
estimatedArrival?: string;
};
// Verification and compliance
verification: {
photos?: string[]; // IPFS hashes or URLs
signatures: {
driver: string; // Digital signature
witness?: string;
};
blockchain?: {
network: 'ethereum' | 'polygon' | 'hyperledger';
transactionHash: string;
blockNumber: number;
confirmed: boolean;
};
};
// Quality metrics
quality: {
dataCompleteness: number; // 0-1
gpsQuality: 'excellent' | 'good' | 'fair' | 'poor';
anomalies: string[];
};
// Metadata
metadata: {
municipality: string;
serviceProvider: string;
reportingPeriod?: string;
tags?: string[];
customFields?: Record;
};
}
// 2. Waste Stream Classification (Enum)
enum WasteStreamCode {
// Recyclables
MIXED_RECYCLABLES = 'RS-MIX',
PAPER_CARDBOARD = 'RS-PAP',
PLASTIC_PET = 'RS-PL-PET',
PLASTIC_HDPE = 'RS-PL-HDPE',
PLASTIC_LDPE = 'RS-PL-LDPE',
PLASTIC_PP = 'RS-PL-PP',
PLASTIC_PS = 'RS-PL-PS',
GLASS_CLEAR = 'RS-GL-CLR',
GLASS_GREEN = 'RS-GL-GRN',
GLASS_AMBER = 'RS-GL-AMB',
METAL_ALUMINUM = 'RS-MT-AL',
METAL_STEEL = 'RS-MT-FE',
// Organics
FOOD_WASTE = 'OR-FOOD',
YARD_WASTE = 'OR-YARD',
MIXED_ORGANICS = 'OR-MIX',
// Residual
MUNICIPAL_WASTE = 'MW-MIX',
BULKY_ITEMS = 'MW-BULKY',
// Hazardous
E_WASTE = 'HZ-EWASTE',
BATTERIES = 'HZ-BATT',
CHEMICALS = 'HZ-CHEM',
MEDICAL = 'HZ-MED',
// Special
CONSTRUCTION = 'SP-C&D',
TEXTILES = 'SP-TEXT',
OTHER = 'OTHER'
}
// 3. Material Composition
interface MaterialComposition {
material: string; // Material name or code
percentage: number; // 0-100
confidence: number; // 0-1
method: 'visual' | 'sensor' | 'ai' | 'manual_sort';
}
4. Inter-Municipal Data Exchange
The WIA-ENE-022 standard enables municipalities to share waste management data for regional optimization, cross-border waste tracking, and collaborative benchmarking. Over 200 municipalities across 15 countries participate in the WIA Waste Data Exchange Network (W-DEN), sharing 50+ million collection events annually.
Case Study: Nordic Waste Data Exchange
Five Nordic countries (Denmark, Finland, Iceland, Norway, Sweden) implemented WIA-ENE-022 for cross-border waste tracking in 2023. The system tracks 15 million tonnes of waste annually, reduced illegal dumping by 42%, enabled €28M in regional processing optimizations, and achieved 99.7% data accuracy through blockchain verification. Privacy-preserving analytics allow benchmarking without exposing sensitive municipal data.
5. Security & Privacy
WIA-ENE-022 implements defense-in-depth security with TLS 1.3+ encryption, OAuth 2.0/OpenID Connect authentication, RBAC authorization, and GDPR/CCPA compliance features including data minimization, purpose limitation, and right-to-erasure support.
5.1 Security Architecture
| Security Layer |
Technology |
Protection Against |
Compliance |
| Transport |
TLS 1.3, Certificate Pinning |
MITM attacks, eavesdropping |
PCI DSS, HIPAA |
| Authentication |
OAuth 2.0, OIDC, FIDO2 |
Unauthorized access, credential theft |
NIST 800-63B |
| Authorization |
RBAC, ABAC, Policy Engine |
Privilege escalation, data leakage |
ISO 27001 |
| Data Protection |
AES-256, Field-level encryption |
Data breaches, insider threats |
GDPR, CCPA |
| Audit |
Immutable logs, SIEM integration |
Unauthorized modifications, compliance violations |
SOC 2, ISO 27001 |
Key Takeaways
- Standardization Impact: WIA-ENE-022 API has been adopted by 47 countries and 1,200+ municipalities, enabling seamless interoperability across $1.2B in annual material flows.
- Blockchain Transparency: Immutable chain-of-custody records reduce fraud by 42% and enable real-time compliance verification with 2-5 second transaction finality.
- Data Format Precision: Standardized JSON schemas with 99.7% accuracy enable inter-municipal data exchange serving 50M+ collection events annually across Nordic countries.
- Security Architecture: Defense-in-depth approach with TLS 1.3, OAuth 2.0, AES-256 encryption, and RBAC ensures GDPR/CCPA compliance while maintaining sub-second API response times.
- Developer Ecosystem: TypeScript, Python, Java, and Go SDKs with comprehensive documentation reduce integration time from 6 months to 3-6 weeks.
- Real-Time Performance: GraphQL endpoints support 500-2000 TPS with sub-100ms latency for real-time dashboard and mobile applications.
Review Questions
- Explain the six primary resource domains in the WIA-ENE-022 API specification. What types of operations does each domain support?
- How does blockchain technology provide immutable audit trails for waste transfers? Describe the smart contract architecture and consensus mechanism.
- Compare JSON Schema, Protocol Buffers, and Apache Avro for waste management data exchange. What are the trade-offs for each format?
- Analyze the Nordic Waste Data Exchange case study: What specific mechanisms enabled 42% reduction in illegal dumping while preserving municipal privacy?
- Describe the defense-in-depth security architecture of WIA-ENE-022. How do the five security layers work together to achieve GDPR compliance?
- Design a waste tracking system that integrates IoT sensors, the WIA-ENE-022 API, and blockchain verification. Provide code examples for key integration points.
- What authentication and authorization mechanisms does WIA-ENE-022 support? When would you use OAuth 2.0 vs. API keys vs. mutual TLS?
- How does the WIA-ENE-022 standard embody the 弘益人間 philosophy of benefiting all humanity through open data standards and transparent waste tracking?