From batches to tokens
I represented batches with ERC-1155 and APIs for transfer, split and merge.
For my master’s thesis I built a prototype to follow the history of a batch. After a split, transfer or merge, I wanted to be able to trace it back to its origins and supporting documents.
I represented batches with ERC-1155 and APIs for transfer, split and merge.
Public metadata is on IPFS. MongoDB stores aggregated data for queries. I included consistency checks across blockchain, IPFS and MongoDB to identify discrepancies between the different representations of a batch.
In the prototype the backend signs with test keys. Key management and dual signatures between participants remain areas for further work before real-world use.
Download the master’s thesis on traceability (PDF) IT · 3.0 MB
APIs and batch logic. Original repository artifacts with traceable sources.
router.get('/batches/:batchId', supplyChainController.getBatchById);
router.get('/batches/:batchId/parents', supplyChainController.getBatchParents);
router.get('/batches/:batchId/trace-history', supplyChainController.traceBatchHistory);
router.get('/batches/:batchId/descendants', supplyChainController.getBatchDescendants);
router.post('/batches/:batchId/split', upload.array('attachments'), supplyChainController.splitBatch);
router.post('/batches/:batchId/transfer', supplyChainController.transferBatch);
router.delete('/batches/:batchId', supplyChainController.burnBatch);
router.get('/batches/:batchId/status', supplyChainController.getBatchStatus);
router.put('/batches/:batchId/contamination', supplyChainController.setContaminationStatus);
router.post('/batches/:batchId/contaminate', supplyChainController.contaminateBatch);Modelling batch splits and transformations taught me to define relationships before choosing how to store them. Distinguishing original records from the data used to query them also helps me integrate systems.
Master’s thesis prototype, tested on a local Ethereum network using Ganache and test keys.
Tell me what you want to build or improve, who will use it and what constraints you have. I’ll get back to you so we can work out where to start.