@genobank/biofs 2.5.0 โ 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE +37 -0
- package/README.md +2 -1
- package/bin/biofs.js +2 -1
- package/contracts/ClaraJobNFT.sol +2 -0
- package/dist/commands/link-clara.d.ts.map +1 -1
- package/dist/commands/link-clara.js +9 -3
- package/dist/commands/link-clara.js.map +1 -1
- package/dist/commands/tokenize-biosample.d.ts.map +1 -1
- package/dist/commands/tokenize-biosample.js +9 -3
- package/dist/commands/tokenize-biosample.js.map +1 -1
- package/dist/index.js +1 -1
- package/docs/AI_AGENT_MCP_MANUAL.md +2 -0
- package/docs/USER_MANUAL.md +2 -0
- package/docs/technical-details.html +555 -0
- package/lib/bionfs-client.js +2 -0
- package/lib/consent-manager.js +2 -0
- package/lib/consent-prompt.js +2 -0
- package/package.json +3 -3
- package/presentation/biofs-x402-kite-presentation.html +2 -0
- package/scripts/build_annotator_dictionary.py +1 -0
- package/scripts/deploy-clara-nft.js +2 -0
- package/test-complete-flow.sh +1 -1
- package/test.vcf +1 -0
- package/test_23andme.txt +1 -0
- package/ADMIN_REGISTER_LAB.md +0 -252
- package/ANNOTATOR_RECOMMENDATIONS_API.md +0 -490
- package/BIOFS_QUICK_START.md +0 -200
- package/BIOFS_TOKENIZE_COMPLETE.md +0 -541
- package/BIOFS_V1.2.7_PUBLISHED.md +0 -317
- package/BIOFS_V1.2.9_FIXES.md +0 -306
- package/BIOFS_V1.3.0_DIRECT_GRANT.md +0 -381
- package/BIOFS_V1.3.1_GRANTED_FILES.md +0 -328
- package/BIONFS_DEPLOYMENT_GUIDE.md +0 -408
- package/BIONFS_MOUNT_INTEGRATION_PLAN.md +0 -415
- package/BIONFS_PROTOCOL_SPECIFICATION.md +0 -688
- package/BIONFS_SEQUENTIAS_INTEGRATION.md +0 -457
- package/BIONFT_NFS_PROTOCOL_ARCHITECTURE.md +0 -583
- package/BIOOS_CLI_IMPLEMENTATION_COMPLETE.md +0 -422
- package/BIOOS_JOB_MANAGEMENT.md +0 -681
- package/BUGFIX_V2.1.3.md +0 -72
- package/CHANGELOG_V2.1.0.md +0 -386
- package/CHANGELOG_V2.2.0.md +0 -284
- package/ENHANCEMENT_DOCUMENTATION.md +0 -218
- package/GDPR_BIONFS_CONSENT_ARCHITECTURE.md +0 -798
- package/GDPR_BIONFS_IMPLEMENTATION_STATUS.md +0 -462
- package/INSTALL_V1.2.7_ON_MAC.md +0 -306
- package/LABNFT_BIOFS_INTEGRATION.md +0 -396
- package/OPENCRAVAT_ANNOTATORS_REFERENCE.md +0 -340
- package/OPENCRAVAT_ANNOTATOR_INTELLIGENCE_COMPLETE.md +0 -479
- package/QUICK_START_V2.1.0.md +0 -116
- package/RELEASE_SUMMARY_V1.2.7.md +0 -479
- package/RELEASE_SUMMARY_V1.3.0.md +0 -324
- package/SEQUENTIAS_PROTOCOL_ARCHITECTURE.md +0 -880
- package/SEQUENTIA_MIGRATION_GUIDE.md +0 -337
- package/SESSION_SUMMARY_DIRECT_GRANT.md +0 -321
- package/ULTRATHINK_BIONFS_COMPLETE.md +0 -458
- package/WEB3FUSE_LICENSE_TOKEN_ANALYSIS.md +0 -494
- package/WHERE_PERMISSIONS_LIVE.md +0 -165
- package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.json +0 -63
- package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.json +0 -328
- package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +0 -357
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +0 -296
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.json +0 -45
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.json +0 -373
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.json +0 -341
- package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +0 -30
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +0 -30
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +0 -10
- package/artifacts/build-info/1adfbc50ae3e1821260f858a9c689a37.json +0 -1
- package/artifacts/contracts/ClaraJobNFT.sol/ClaraJobNFT.dbg.json +0 -4
- package/artifacts/contracts/ClaraJobNFT.sol/ClaraJobNFT.json +0 -667
- package/cache/solidity-files-cache.json +0 -628
- package/check_clara2.js +0 -70
- package/check_clara3.js +0 -65
- package/config.json +0 -21
- package/hardhat.config.js +0 -25
- package/jest.config.js +0 -27
- package/mint_and_link_all.js +0 -128
- package/opencravat_annotators_dictionary.json +0 -2356
- package/package.json.working.v1.9.2.20251105_023952 +0 -48
- package/test_v2_mint.js +0 -101
|
@@ -1,541 +0,0 @@
|
|
|
1
|
-
# BioFS Tokenize Command - Complete Implementation
|
|
2
|
-
|
|
3
|
-
**Date:** October 4, 2025
|
|
4
|
-
**Status:** โ
**FULLY OPERATIONAL**
|
|
5
|
-
**Version:** 1.0.0
|
|
6
|
-
|
|
7
|
-
## ๐ Overview
|
|
8
|
-
|
|
9
|
-
The `biofs tokenize` command is now fully implemented and follows the exact workflow of bioip.genobank.app for tokenizing genomic datasets as BioIP NFTs on Story Protocol blockchain.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## โ
What Was Built
|
|
14
|
-
|
|
15
|
-
### 1. Core Tokenization Command
|
|
16
|
-
|
|
17
|
-
**Command Signature:**
|
|
18
|
-
```bash
|
|
19
|
-
biofs tokenize <file> [options]
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Available Options:**
|
|
23
|
-
- `--title <string>` - Custom title for the NFT (auto-generated if not provided)
|
|
24
|
-
- `--description <string>` - Custom description (uses Gemini AI if not provided)
|
|
25
|
-
- `--license <type>` - License type: `commercial` or `non-commercial` (default: non-commercial)
|
|
26
|
-
- `--collection <address>` - Manual collection address override
|
|
27
|
-
- `--network <network>` - Story Protocol network: `mainnet` or `testnet` (default: mainnet)
|
|
28
|
-
- `--no-ai` - Skip AI classification
|
|
29
|
-
- `--quiet` - No interactive prompts
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## ๐ Story Protocol Network Support
|
|
34
|
-
|
|
35
|
-
### Mainnet (Production)
|
|
36
|
-
- **RPC:** `https://rpc.story.foundation`
|
|
37
|
-
- **Chain ID:** `1516`
|
|
38
|
-
- **Explorer:** `https://explorer.story.foundation`
|
|
39
|
-
- **Usage:** Default network for production tokenization
|
|
40
|
-
|
|
41
|
-
### Testnet (Odyssey)
|
|
42
|
-
- **RPC:** `https://testnet.storyrpc.io`
|
|
43
|
-
- **Chain ID:** `1513`
|
|
44
|
-
- **Explorer:** `https://testnet.storyscan.xyz`
|
|
45
|
-
- **Usage:** For testing before mainnet deployment
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## ๐ง Complete Tokenization Workflow
|
|
50
|
-
|
|
51
|
-
### Step-by-Step Process:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
1. FILE VALIDATION โ
|
|
55
|
-
โโ> Checks file exists and is readable
|
|
56
|
-
โโ> Validates file extension (vcf, txt, fastq, bam, etc.)
|
|
57
|
-
โโ> Gets file size and basic metadata
|
|
58
|
-
|
|
59
|
-
2. AUTHENTICATION CHECK โ
|
|
60
|
-
โโ> Loads credentials from ~/.genobank/credentials.json
|
|
61
|
-
โโ> Validates user_signature and wallet_address
|
|
62
|
-
โโ> Confirms user is authenticated
|
|
63
|
-
|
|
64
|
-
3. NETWORK SELECTION โ
|
|
65
|
-
โโ> Selects Story Protocol network (mainnet/testnet)
|
|
66
|
-
โโ> Configures RPC and Chain ID
|
|
67
|
-
โโ> Sets appropriate explorer URL
|
|
68
|
-
|
|
69
|
-
4. FINGERPRINT CALCULATION โ
|
|
70
|
-
โโ> For VCF files: Extracts SNPs (chr:pos:ref:alt)
|
|
71
|
-
โโ> For 23andMe/Ancestry: Extracts rsID:genotype pairs
|
|
72
|
-
โโ> Limits to first 10,000 SNPs for consistency
|
|
73
|
-
โโ> Generates MD5 hash of sorted SNP list
|
|
74
|
-
โโ> Used for duplicate detection
|
|
75
|
-
|
|
76
|
-
5. AI CLASSIFICATION (Optional) โ
|
|
77
|
-
โโ> Sends file sample to Gemini AI
|
|
78
|
-
โโ> Gets intelligent description (2-3 sentences)
|
|
79
|
-
โโ> Auto-detects dataset category
|
|
80
|
-
โโ> Suggests title based on content
|
|
81
|
-
โโ> Can be skipped with --no-ai flag
|
|
82
|
-
|
|
83
|
-
6. COLLECTION SELECTION โ
|
|
84
|
-
โโ> Auto-selects based on file category:
|
|
85
|
-
โข VCF โ 0x19A615224D03487AaDdC43e4520F9D83923d9512
|
|
86
|
-
โข Genomic โ 0x5021F7438ea502b0c346cB59F8E92B749Ecd74B5
|
|
87
|
-
โข GWAS/SNP/23andMe โ 0x29853ed299B8FBBe16568840F3Bb2A8E40dc7401
|
|
88
|
-
โข BAM/SAM โ 0xB8d03f2E1C02e4cC5b5fe1613c575c01BDD12269
|
|
89
|
-
โข FASTQ/FASTA โ 0x88Ed5b47ea8f609Ee14ac60968C3f76f9138a171
|
|
90
|
-
โโ> Manual override available with --collection flag
|
|
91
|
-
|
|
92
|
-
7. LICENSE CONFIGURATION โ
|
|
93
|
-
โโ> Story Protocol PIL (Programmable IP License)
|
|
94
|
-
โโ> Non-commercial: PIL_NON_COMMERCIAL_REMIX (default)
|
|
95
|
-
โโ> Commercial: PIL_COMMERCIAL_REMIX
|
|
96
|
-
โโ> Sets on-chain licensing terms
|
|
97
|
-
|
|
98
|
-
8. METADATA PREPARATION โ
|
|
99
|
-
โโ> Title: From --title or AI suggestion or filename
|
|
100
|
-
โโ> Description: From --description or AI or auto-generated
|
|
101
|
-
โโ> NFT Traits:
|
|
102
|
-
โข File Type (VCF, FASTQ, etc.)
|
|
103
|
-
โข File Size (bytes)
|
|
104
|
-
โข SNP Count (for genomic files)
|
|
105
|
-
โข Fingerprint Hash
|
|
106
|
-
โข Created Date
|
|
107
|
-
โข Category
|
|
108
|
-
โโ> Image: Auto-selected category-appropriate image
|
|
109
|
-
|
|
110
|
-
9. API SUBMISSION โ
|
|
111
|
-
โโ> Uploads to /api_bioip/register_bioip
|
|
112
|
-
โโ> Includes all metadata and file
|
|
113
|
-
โโ> Shows upload progress
|
|
114
|
-
โโ> Handles errors gracefully
|
|
115
|
-
|
|
116
|
-
10. NFT MINTING โ
|
|
117
|
-
โโ> Server-side minting using BIOSAMPLE_EXECUTOR wallet
|
|
118
|
-
โโ> Mints on selected Story Protocol network
|
|
119
|
-
โโ> Registers as IP Asset
|
|
120
|
-
โโ> Attaches PIL license terms
|
|
121
|
-
โโ> Returns IP Asset ID and transaction hash
|
|
122
|
-
|
|
123
|
-
11. BIOCID GENERATION โ
|
|
124
|
-
โโ> Format: biocid://<wallet>/<category>/<filename>
|
|
125
|
-
โโ> Example: biocid://0x5f5a.../variant/my-genome.vcf
|
|
126
|
-
โโ> Universal identifier for cross-platform access
|
|
127
|
-
|
|
128
|
-
12. RESULT DISPLAY โ
|
|
129
|
-
โโ> Shows all tokenization details
|
|
130
|
-
โโ> Provides explorer link
|
|
131
|
-
โโ> Saves local record
|
|
132
|
-
โโ> Displays BioCID
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## ๐ Usage Examples
|
|
138
|
-
|
|
139
|
-
### Basic Tokenization (Mainnet, Non-Commercial)
|
|
140
|
-
```bash
|
|
141
|
-
biofs tokenize my-genome.vcf
|
|
142
|
-
```
|
|
143
|
-
**Output:**
|
|
144
|
-
```
|
|
145
|
-
๐งฌ BioFS Tokenization
|
|
146
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
147
|
-
|
|
148
|
-
โ
File validated: my-genome.vcf (2.5 MB)
|
|
149
|
-
โ
Authenticated: 0x5f5a60Ea...
|
|
150
|
-
โ
Network: Story Protocol Mainnet (Chain ID: 1516)
|
|
151
|
-
โ
Fingerprint: 3a4f7d2c... (10,000 SNPs)
|
|
152
|
-
โ
AI Classification: Variant Call Format
|
|
153
|
-
โ
Collection: VCF Analysis (0x19A6...9512)
|
|
154
|
-
โ
Upload complete
|
|
155
|
-
โ
NFT minted successfully!
|
|
156
|
-
|
|
157
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
158
|
-
๐ BioIP Tokenization Successful!
|
|
159
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
160
|
-
|
|
161
|
-
๐ฆ IP Asset ID: 0x4925ef6c5FbE63F9d5cF9FB20c074497FaB694C0
|
|
162
|
-
๐ BioCID: biocid://0x5f5a.../variant/my-genome.vcf
|
|
163
|
-
๐๏ธ License: Non-Commercial Remix
|
|
164
|
-
๐ Collection: VCF Analysis
|
|
165
|
-
|
|
166
|
-
๐ View on Explorer:
|
|
167
|
-
https://explorer.story.foundation/ipa/0x4925ef6c5FbE63F9d5cF9FB20c074497FaB694C0
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Testnet with Commercial License
|
|
171
|
-
```bash
|
|
172
|
-
biofs tokenize research-data.txt --network testnet --license commercial
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Custom Metadata (No AI)
|
|
176
|
-
```bash
|
|
177
|
-
biofs tokenize genome.vcf \
|
|
178
|
-
--title "Clinical Whole Genome Sequencing" \
|
|
179
|
-
--description "WGS for hereditary cancer research" \
|
|
180
|
-
--no-ai
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### Manual Collection Selection
|
|
184
|
-
```bash
|
|
185
|
-
biofs tokenize alignment.bam \
|
|
186
|
-
--collection 0xB8d03f2E1C02e4cC5b5fe1613c575c01BDD12269 \
|
|
187
|
-
--network mainnet
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### 23andMe/Ancestry File
|
|
191
|
-
```bash
|
|
192
|
-
biofs tokenize my_23andme_data.txt
|
|
193
|
-
```
|
|
194
|
-
**Auto-detects:** DTC category, uses GWAS collection
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## ๐๏ธ File Type Support
|
|
199
|
-
|
|
200
|
-
| File Type | Extension | Category | Collection Address |
|
|
201
|
-
|-----------|-----------|----------|-------------------|
|
|
202
|
-
| VCF | `.vcf` | variant | `0x19A6...9512` |
|
|
203
|
-
| 23andMe/Ancestry | `.txt` | dtc | `0x2985...7401` |
|
|
204
|
-
| BAM | `.bam` | alignment | `0xB8d0...2269` |
|
|
205
|
-
| SAM | `.sam` | alignment | `0xB8d0...2269` |
|
|
206
|
-
| FASTQ | `.fastq`, `.fq` | sequence | `0x88Ed...9171` |
|
|
207
|
-
| FASTA | `.fasta`, `.fa` | sequence | `0x88Ed...9171` |
|
|
208
|
-
| GFF | `.gff` | annotation | `0x88Ed...9171` |
|
|
209
|
-
| GTF | `.gtf` | annotation | `0x88Ed...9171` |
|
|
210
|
-
| BED | `.bed` | annotation | `0x88Ed...9171` |
|
|
211
|
-
| DICOM | `.dicom`, `.dcm` | medical_imaging | `0x5021...74B5` |
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
## ๐งฌ Fingerprint Algorithm
|
|
216
|
-
|
|
217
|
-
### VCF Files
|
|
218
|
-
```typescript
|
|
219
|
-
1. Read VCF file line by line
|
|
220
|
-
2. Skip header lines (starting with #)
|
|
221
|
-
3. For each variant:
|
|
222
|
-
- Extract: chromosome, position, ref, alt
|
|
223
|
-
- Create SNP ID: "chr1:100:A:G"
|
|
224
|
-
4. Collect up to 10,000 SNPs
|
|
225
|
-
5. Sort SNPs alphabetically
|
|
226
|
-
6. Join with commas: "chr1:100:A:G,chr1:200:C:T,..."
|
|
227
|
-
7. Calculate MD5 hash
|
|
228
|
-
8. Use for duplicate detection
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### 23andMe/Ancestry Files
|
|
232
|
-
```typescript
|
|
233
|
-
1. Read file line by line
|
|
234
|
-
2. Skip comment lines (starting with #)
|
|
235
|
-
3. For each SNP:
|
|
236
|
-
- Extract: rsID, genotype
|
|
237
|
-
- Create pair: "rs12345:AG"
|
|
238
|
-
4. Collect up to 10,000 SNPs
|
|
239
|
-
5. Sort alphabetically
|
|
240
|
-
6. Join with commas
|
|
241
|
-
7. Calculate MD5 hash
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### Other Files
|
|
245
|
-
```typescript
|
|
246
|
-
1. Read entire file content
|
|
247
|
-
2. Calculate MD5 hash of content
|
|
248
|
-
3. Use for file integrity verification
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## ๐ค AI Classification
|
|
254
|
-
|
|
255
|
-
### Gemini AI Integration
|
|
256
|
-
|
|
257
|
-
**API:** Google Generative AI (Gemini Pro)
|
|
258
|
-
**Key:** `AIzaSyCuPPjSPkHTbu2YBoyZjUB-o-xCnhCNaac`
|
|
259
|
-
|
|
260
|
-
**What AI Does:**
|
|
261
|
-
1. Analyzes first 100 lines of file
|
|
262
|
-
2. Identifies file type and format
|
|
263
|
-
3. Generates 2-3 sentence description
|
|
264
|
-
4. Suggests appropriate title
|
|
265
|
-
5. Determines best category
|
|
266
|
-
|
|
267
|
-
**Example Output:**
|
|
268
|
-
```json
|
|
269
|
-
{
|
|
270
|
-
"description": "Whole genome sequencing variant calls from Illumina platform, containing approximately 4.5 million variants across all chromosomes. High-quality calls filtered for clinical significance.",
|
|
271
|
-
"category": "variant",
|
|
272
|
-
"suggestedTitle": "Clinical WGS Variant Analysis"
|
|
273
|
-
}
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
**Can be disabled** with `--no-ai` flag for faster processing or custom metadata.
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
## ๐ Story Protocol PIL Licensing
|
|
281
|
-
|
|
282
|
-
### License Types Supported
|
|
283
|
-
|
|
284
|
-
#### Non-Commercial (Default)
|
|
285
|
-
- **PIL Term:** `PIL_NON_COMMERCIAL_REMIX`
|
|
286
|
-
- **Allows:**
|
|
287
|
-
- Non-commercial use
|
|
288
|
-
- Derivative works
|
|
289
|
-
- Attribution required
|
|
290
|
-
- **Forbids:**
|
|
291
|
-
- Commercial use
|
|
292
|
-
- Selling derivatives
|
|
293
|
-
- **Usage:** `--license non-commercial` (or omit flag)
|
|
294
|
-
|
|
295
|
-
#### Commercial
|
|
296
|
-
- **PIL Term:** `PIL_COMMERCIAL_REMIX`
|
|
297
|
-
- **Allows:**
|
|
298
|
-
- Commercial use
|
|
299
|
-
- Derivative works
|
|
300
|
-
- Revenue from derivatives
|
|
301
|
-
- Attribution required
|
|
302
|
-
- **Usage:** `--license commercial`
|
|
303
|
-
|
|
304
|
-
### On-Chain Enforcement
|
|
305
|
-
- License terms stored on Story Protocol blockchain
|
|
306
|
-
- Immutable and transparent
|
|
307
|
-
- Automatically inherited by derivatives
|
|
308
|
-
- Royalty tracking built-in
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
|
|
312
|
-
## ๐ Security & Privacy
|
|
313
|
-
|
|
314
|
-
### Authentication
|
|
315
|
-
- Uses existing `~/.genobank/credentials.json`
|
|
316
|
-
- No re-authentication needed
|
|
317
|
-
- Web3 signature verified by API
|
|
318
|
-
- Wallet ownership confirmed
|
|
319
|
-
|
|
320
|
-
### Private Key Handling
|
|
321
|
-
- **BIOSAMPLE_EXECUTOR** private key NEVER exposed to CLI
|
|
322
|
-
- All blockchain transactions signed server-side
|
|
323
|
-
- CLI only sends data, API handles minting
|
|
324
|
-
- Zero-trust architecture
|
|
325
|
-
|
|
326
|
-
### Data Storage
|
|
327
|
-
- **Public (Blockchain):** IP Asset ID, collection, license type
|
|
328
|
-
- **Public (IPFS):** NFT metadata, description, traits, image
|
|
329
|
-
- **Private (MongoDB):** S3 path, wallet address, fingerprint
|
|
330
|
-
- **Never Public:** Genomic file content, S3 paths, user data
|
|
331
|
-
|
|
332
|
-
### Fingerprint Privacy
|
|
333
|
-
- Fingerprint is MD5 hash of SNP list
|
|
334
|
-
- Does not expose raw genomic data
|
|
335
|
-
- Sufficient for duplicate detection
|
|
336
|
-
- Cannot reverse-engineer genome from hash
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
## ๐ Collection Addresses
|
|
341
|
-
|
|
342
|
-
### Story Protocol Mainnet Collections
|
|
343
|
-
|
|
344
|
-
```javascript
|
|
345
|
-
const BIOIP_COLLECTIONS = {
|
|
346
|
-
'genomic': '0x5021F7438ea502b0c346cB59F8E92B749Ecd74B5',
|
|
347
|
-
'variant': '0x19A615224D03487AaDdC43e4520F9D83923d9512',
|
|
348
|
-
'alignment': '0xB8d03f2E1C02e4cC5b5fe1613c575c01BDD12269',
|
|
349
|
-
'sequence': '0x88Ed5b47ea8f609Ee14ac60968C3f76f9138a171',
|
|
350
|
-
'annotation': '0x88Ed5b47ea8f609Ee14ac60968C3f76f9138a171',
|
|
351
|
-
'microarray': '0x29853ed299B8FBBe16568840F3Bb2A8E40dc7401',
|
|
352
|
-
'snp': '0x29853ed299B8FBBe16568840F3Bb2A8E40dc7401',
|
|
353
|
-
'gwas': '0x29853ed299B8FBBe16568840F3Bb2A8E40dc7401',
|
|
354
|
-
'dtc': '0x29853ed299B8FBBe16568840F3Bb2A8E40dc7401',
|
|
355
|
-
'medical_imaging': '0x5021F7438ea502b0c346cB59F8E92B749Ecd74B5',
|
|
356
|
-
'medical': '0x5021F7438ea502b0c346cB59F8E92B749Ecd74B5'
|
|
357
|
-
};
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
**Note:** Testnet uses same addresses but on different chain (1513).
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
## ๐ BioCID Format
|
|
365
|
-
|
|
366
|
-
### Structure
|
|
367
|
-
```
|
|
368
|
-
biocid://<wallet_address>/<category>/<filename>
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
### Examples
|
|
372
|
-
```
|
|
373
|
-
biocid://0x5f5a60eaef242c0d51a21c703f520347b96ed19a/variant/my-genome.vcf
|
|
374
|
-
biocid://0x5f5a60eaef242c0d51a21c703f520347b96ed19a/dtc/23andme_data.txt
|
|
375
|
-
biocid://0x5f5a60eaef242c0d51a21c703f520347b96ed19a/sequence/sample_R1.fastq
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
### Usage
|
|
379
|
-
- Universal identifier across GenoBank ecosystem
|
|
380
|
-
- Used in `biofs download` command
|
|
381
|
-
- Resolves to S3/IPFS/Story Protocol
|
|
382
|
-
- Platform-independent file reference
|
|
383
|
-
|
|
384
|
-
---
|
|
385
|
-
|
|
386
|
-
## ๐ Implementation Files
|
|
387
|
-
|
|
388
|
-
### Core Command
|
|
389
|
-
- `/home/ubuntu/genobank-cli/src/commands/tokenize.ts` - Main command logic
|
|
390
|
-
- `/home/ubuntu/genobank-cli/src/index.ts` - Command registration
|
|
391
|
-
|
|
392
|
-
### Supporting Libraries
|
|
393
|
-
- `/home/ubuntu/genobank-cli/src/lib/biofiles/fingerprint.ts` - Fingerprint calculation
|
|
394
|
-
- `/home/ubuntu/genobank-cli/src/lib/ai/classifier.ts` - Gemini AI integration
|
|
395
|
-
- `/home/ubuntu/genobank-cli/src/lib/bioip/collections.ts` - Collection mapping
|
|
396
|
-
- `/home/ubuntu/genobank-cli/src/lib/bioip/licenses.ts` - License type mapping
|
|
397
|
-
- `/home/ubuntu/genobank-cli/src/lib/config/constants.ts` - Network configuration
|
|
398
|
-
- `/home/ubuntu/genobank-cli/src/lib/storage/tokenizations.ts` - Local record storage
|
|
399
|
-
|
|
400
|
-
### Configuration
|
|
401
|
-
- `/home/ubuntu/genobank-cli/.env` - Environment variables
|
|
402
|
-
- `/home/ubuntu/genobank-cli/package.json` - Dependencies
|
|
403
|
-
|
|
404
|
-
### Dependencies Added
|
|
405
|
-
```json
|
|
406
|
-
{
|
|
407
|
-
"@google/generative-ai": "^0.24.1" // Gemini AI SDK
|
|
408
|
-
}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
---
|
|
412
|
-
|
|
413
|
-
## ๐งช Testing
|
|
414
|
-
|
|
415
|
-
### Test Files
|
|
416
|
-
|
|
417
|
-
**Create test VCF:**
|
|
418
|
-
```bash
|
|
419
|
-
cat > test.vcf << 'EOF'
|
|
420
|
-
##fileformat=VCFv4.2
|
|
421
|
-
#CHROM POS ID REF ALT QUAL FILTER INFO
|
|
422
|
-
chr1 100 rs123 A G 30 PASS DP=10
|
|
423
|
-
chr1 200 rs456 C T 40 PASS DP=15
|
|
424
|
-
chr2 300 rs789 G A 50 PASS DP=20
|
|
425
|
-
EOF
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
**Create test 23andMe:**
|
|
429
|
-
```bash
|
|
430
|
-
cat > test_23andme.txt << 'EOF'
|
|
431
|
-
# rsid chromosome position genotype
|
|
432
|
-
rs12345 1 100 AG
|
|
433
|
-
rs67890 2 200 CC
|
|
434
|
-
rs11111 3 300 TT
|
|
435
|
-
EOF
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
### Test Commands
|
|
439
|
-
|
|
440
|
-
```bash
|
|
441
|
-
# Test mainnet tokenization
|
|
442
|
-
biofs tokenize test.vcf
|
|
443
|
-
|
|
444
|
-
# Test testnet
|
|
445
|
-
biofs tokenize test.vcf --network testnet
|
|
446
|
-
|
|
447
|
-
# Test with AI disabled
|
|
448
|
-
biofs tokenize test_23andme.txt --no-ai
|
|
449
|
-
|
|
450
|
-
# Test commercial license
|
|
451
|
-
biofs tokenize test.vcf --license commercial
|
|
452
|
-
|
|
453
|
-
# Test full options
|
|
454
|
-
biofs tokenize test.vcf \
|
|
455
|
-
--title "Test VCF" \
|
|
456
|
-
--description "Test variant file" \
|
|
457
|
-
--license non-commercial \
|
|
458
|
-
--network mainnet
|
|
459
|
-
```
|
|
460
|
-
|
|
461
|
-
---
|
|
462
|
-
|
|
463
|
-
## โ
Success Criteria - All Met!
|
|
464
|
-
|
|
465
|
-
- โ
Command runs without errors
|
|
466
|
-
- โ
File fingerprint calculated correctly for VCF and 23andMe
|
|
467
|
-
- โ
AI classification provides intelligent descriptions
|
|
468
|
-
- โ
Correct collection auto-selected based on file type
|
|
469
|
-
- โ
Network selection works (mainnet/testnet)
|
|
470
|
-
- โ
NFT minted successfully on Story Protocol
|
|
471
|
-
- โ
BioCID generated and displayed
|
|
472
|
-
- โ
Transaction details shown with explorer links
|
|
473
|
-
- โ
Local tokenization records saved
|
|
474
|
-
- โ
Beautiful, informative terminal output
|
|
475
|
-
- โ
Error handling graceful and helpful
|
|
476
|
-
- โ
Secure BIOSAMPLE_EXECUTOR handling
|
|
477
|
-
- โ
PIL licensing properly configured
|
|
478
|
-
|
|
479
|
-
---
|
|
480
|
-
|
|
481
|
-
## ๐ What's Next?
|
|
482
|
-
|
|
483
|
-
### Potential Enhancements
|
|
484
|
-
|
|
485
|
-
1. **Batch Tokenization**
|
|
486
|
-
```bash
|
|
487
|
-
biofs tokenize --batch *.vcf
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
2. **Royalty Configuration**
|
|
491
|
-
```bash
|
|
492
|
-
biofs tokenize file.vcf --royalty 5%
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
3. **Derivative Creation**
|
|
496
|
-
```bash
|
|
497
|
-
biofs tokenize analysis.csv --parent 0x1234...
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
4. **License Token Minting**
|
|
501
|
-
```bash
|
|
502
|
-
biofs mint-license 0x1234... --amount 10
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
5. **Collection Management**
|
|
506
|
-
```bash
|
|
507
|
-
biofs create-collection "My Research" MYRES
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
---
|
|
511
|
-
|
|
512
|
-
## ๐ Related Documentation
|
|
513
|
-
|
|
514
|
-
- **BioFS CLI Guide:** `/home/ubuntu/genobank-cli/README.md`
|
|
515
|
-
- **Quick Start:** `/home/ubuntu/genobank-cli/BIOFS_QUICK_START.md`
|
|
516
|
-
- **Architecture:** `/home/ubuntu/Genobank_APIs/GENOBANK_CLI_ARCHITECTURE.md`
|
|
517
|
-
- **BioIP API:** `/home/ubuntu/Genobank_APIs/production_api/plugins/bioip/api_bioip.py`
|
|
518
|
-
- **Story Protocol DAO:** `/home/ubuntu/Genobank_APIs/production_api/libs/dao/story/story_protocol_manager_dao.py`
|
|
519
|
-
|
|
520
|
-
---
|
|
521
|
-
|
|
522
|
-
## ๐ Conclusion
|
|
523
|
-
|
|
524
|
-
The `biofs tokenize` command is **fully operational** and production-ready! It provides a seamless command-line interface for tokenizing genomic datasets as BioIP NFTs on Story Protocol, with:
|
|
525
|
-
|
|
526
|
-
- โ
AI-powered metadata generation
|
|
527
|
-
- โ
Intelligent fingerprinting for duplicate detection
|
|
528
|
-
- โ
Automatic collection and license selection
|
|
529
|
-
- โ
Multi-network support (mainnet/testnet)
|
|
530
|
-
- โ
Beautiful terminal UX
|
|
531
|
-
- โ
Secure server-side blockchain operations
|
|
532
|
-
- โ
Complete integration with GenoBank ecosystem
|
|
533
|
-
|
|
534
|
-
**Users can now tokenize their genomic data with a single command!** ๐
|
|
535
|
-
|
|
536
|
-
---
|
|
537
|
-
|
|
538
|
-
**Version:** 1.0.0
|
|
539
|
-
**Last Updated:** October 4, 2025
|
|
540
|
-
**Status:** โ
Production Ready
|
|
541
|
-
**Maintained By:** GenoBank.io Team
|