White paper v0.4 on Zenodo: doi.org/10.5281/zenodo.24493819 (version DOI). The concept DOI always resolves to the latest version.
Open recipe for tamper-evident biobank sample provenance, custody and access on the Tezos blockchain.
Tips in tez are welcome at bioid.tez.
BioID is an open recipe for tamper-evident biobank sample tracing on tezos blockchain that any biobank can adapt. Fork it, change it, and run it beside your own LIMS. It is a shared design, not a product and not a patentable invention.
The recipe traces physical tubes on Tezos. Each tube is one FA2 token (TZIP-12). The balance is the volume left in that tube, in µL. When that same tube changes place, the same token moves. A new container, such as an aliquot or an extract, is a new token, and only the volume taken from the parent is burned. The parent token continues with whatever volume remains. Places and processes are wallets: storage, lab benches, work in progress, and shipments in transit. Accepting a shipment is a second, explicit step. Withdrawing consent freezes the lineage first and burns a tube only after physical destruction is confirmed. The off-chain link to the person is then crypto-shredded.
It is an open chain-of-custody and inventory layer beside a local LIMS. The LIMS keeps consent, donor links and clinical context. Personal data stays off-chain. Off-chain records are meant to use shared vocabularies — MIABIS, FHIR Specimen, GA4GH DUO, SPREC and FAIR — while the token follows TZIP-12 and TZIP-21.
The current white paper is docs/whitepaper/BioID-whitepaper-v0.4.md, with a Word and PDF copy. It is published on Zenodo as version 0.4, DOI 10.5281/zenodo.24493819. It describes the recipe as it stands in this repository, with the tested contract proposal in contracts/proposals/. It keeps the mainnet trial as history. Changes are listed in CHANGELOG.md.
The previous published version, v0.3, is in docs/whitepaper/BioID-whitepaper-v0.3.md, with a Word and PDF copy (Zenodo: 10.5281/zenodo.24321810).
An ecosystem that adopts the recipe follows the core operating principles. In short: no personal data on-chain, the ledger follows the physical tube, every holding wallet is registered and typed, and a hand-over between sites is a ship followed by a receive. Wallets should carry a readable Tezos Domains name.
The types, the allowed transitions and the registry format are in Wallet types. The JSON Schema is schemas/wallet-registry.schema.json. The synthetic example is examples/wallet-registry.example.json. This repository holds the format and that example only. A real ecosystem publishes its own registry elsewhere.
What a tube is, where it has been, how much is left, and whether it may still be used are usually locked inside one laboratory's LIMS. A partner who receives the tube cannot independently check the hand-over. Aliquots and extracts lose a shared, inspectable parent link. Consent withdrawal is a local database update, with no common proof that further use stopped.
Scanners and the local LIMS stay the system of entry. A signing service turns a physical event into a signed operation. The contract records the custody change. An indexer such as TzKT reads balances and events and feeds them back so the LIMS can reconcile.
flowchart TB
subgraph OffChain["Off-chain (biobank)"]
Scan["2D tube scanner<br/>reception, freezers, lab benches"]
LIMS["Local LIMS / catalogue<br/>donor link, consent register, FAIR metadata"]
Signer["Signing service<br/>(HSM / KMS, custodian keys)"]
Mon["Stuck-tube monitor<br/>(transit / process age)"]
end
subgraph Tezos["Tezos (open LIMS layer)"]
C["BioID FA2 contract<br/>ledger (µL), lineage, status, events"]
end
Idx["Indexer (TzKT)<br/>inventory, history, dashboards"]
Owner["Sample owner / withdrawal officer"]
Scan -->|"physical event"| LIMS
LIMS -->|"move / receive / transform / consume"| Signer
Signer -->|"signed operation"| C
C -->|"events, balances"| Idx
Idx -->|"reconciliation"| LIMS
Idx -->|"age alerts"| Mon
Owner -->|"withdraw()"| C
Day to day the contract does six things:
- Mint a primary tube into a wallet. The balance is the volume in µL. Minting is also how a new daughter tube or extract appears.
- Move the same token when that tube changes place, between storage, process and transit wallets. A move does not mint or burn.
- Receive is the second step of a hand-over. Only the receiving custodian can accept a tube out of transit. Same token.
- Transform mints child tokens (aliquot, split, DNA or RNA extract, library) that point at their parent, and burns only the volume taken from the parent.
- Consume burns volume that was used, discarded or lost.
- Withdraw freezes every descendant of a root sample. A tube is burned with reason
withdrawn-destroyedonly after a custodian confirms physical destruction. The consent-register entry stays off-chain and can be deleted.
The same physical tube, in a new place, is a move of the token it already has. The transfer history is the journey. A new container gets a new token, because it has its own 2D code: scanning it shows that tube's journey and, through parent_id, where the volume came from. The parent is not replaced. The full rule is in Wallet types.
| What happened | On-chain |
|---|---|
| Same tube changes place (storage, intake, process, transit, quarantine) | MOVE the existing token. No mint, no burn. |
| New container (aliquot, extract, library, …) | MINT a new token with parent_id. BURN only the volume taken. The parent keeps the rest. |
| Volume used up, lost or destroyed | BURN that amount, with a reason code. |
| Measured volume differs from nominal | adjust_volume. No mint. |
The diagram above is the architecture overview from the concept note.
Shadownet testnet demo, synthetic data only. The FA2 contract is deployed as KT1HpDatoa5tHDctAQDY7wQgVEnrWJ9S3vix. The phone viewer reads it. An Android prototype offers the same read-only lookup natively, and can ship or receive on a Shadownet custody prototype through a local signing service (no keys on the phone). Mainnet is not in use. Tube codes, volumes, wallet names and events in this repository are invented.
| Path | What it is |
|---|---|
docs/ |
Principles, wallet types, LIMS integration, concept note, argumentation, PDFs, and the GitHub Pages site |
schemas/ |
JSON Schema for a wallet registry |
contracts/ |
SmartPy FA2 contract and the Shadownet origination script |
pilot/ |
Synthetic public-demo feed: reception, aliquots, RNA extract, retrieval for an external user |
bridge/ |
Reference LIMS bridge. Runs offline on a mock ledger |
app/ |
Static phone viewer: scan or open a tube, read volume, custody, lineage, and datasets from TzKT |
apps/android-tubecheck/ |
Android prototype: the same read-only Verify lookup on a phone, plus Ship/Receive against a Shadownet-only signing service |
examples/ |
Synthetic sample data, a synthetic wallet registry, and a synthetic LIMS feed |
- Core operating principles
- Wallet types · registry schema · synthetic registry
- LIMS integration · reference bridge
- Synthetic public demo · FA2 contract · phone viewer · Android prototype
- Concept note · PDF
- Argumentation · PDF
- Contributing
- Security and privacy
docs/ is a minimal Jekyll site using the Minima theme, which GitHub Pages supports. The site is ready to publish from the /docs folder on main. Pages stays off until it is turned on in the repository settings.
When the repository is public and you want the site:
- Open Settings → Pages.
- Under Build and deployment, choose Deploy from a branch.
- Select branch
mainand folder/docs, then save.
The project-site base URL is set in docs/_config.yml as /BioID, matching this repository name. Change baseurl if the repository is renamed.
GitHub renders Mermaid in the Markdown files directly. The Pages layout also loads Mermaid so the same fences render on the site.
Optional local preview, from a machine with Ruby and Bundler:
cd docs
bundle install
bundle exec jekyll serveTips in tez are welcome. Send them to bioid.tez, which resolves to tz1Tm5drMq3zueTpSonJ2FE7P3MBZN9RBNta. View the address on TzKT.
Send only on Tezos mainnet, and double-check the address in your wallet. Most Tezos wallets accept bioid.tez directly. Tips are voluntary. They fund development and hosting. There are no perks.
Code in this repository is under the MIT License, copyright BioID contributors.
Documentation, including the concept note, the argumentation and the other pages under docs/, is under CC BY 4.0. The synthetic examples are included in that documentation licence.