feat: add off-chain weight storage integration (IPFS + Arweave)#13
feat: add off-chain weight storage integration (IPFS + Arweave)#13ahmadfardan464-cmyk wants to merge 3 commits into
Conversation
15 Solidity tests covering full attestation lifecycle: - Deployment: owner set correctly - setAttestationVerifier: configure, update, non-owner revert, zero address revert - registerAndVerifyAttestation: register verified, missing verifier revert, verification fail revert, acceptAll mode, correct hash storage, overwrite, public access - Multiple token attestations - Multiple attestation kinds (ZK-TEE, SGX) - Event emissions verified Also includes Hardhat/ethers.js test file for JS-preferred contributors. Foundry config: solc 0.8.24, optimizer enabled, forge-std dependency. Closes kcolbchain#5
Implements issue kcolbchain#4: tokenURI JSON with model hash, storage CID, architecture description, and training dataset hash. Includes helper script that uploads weights and mints in one flow. Features: - ModelMetadata dataclass with all required fields from kcolbchain#4 - IPFS upload via ipfshttpclient - Arweave upload via arweave-python - Dual storage support (both IPFS + Arweave for redundancy) - SHA-256 model hash computation - Metadata upload to IPFS for tokenURI (with data: URI fallback) - Dry-run mode for testing without actual uploads - CLI: --weights, --name, --architecture, --dataset-hash, --storage Tests (8 passing): - Metadata JSON contains all required fields - Arweave storage type - SHA-256 hash correctness (known values, empty file, large file, uniqueness) Closes kcolbchain#4
abhicris
left a comment
There was a problem hiding this comment.
Good IPFS + Arweave integration! Two things before merge: (1) Remove the committed .pyc file (scripts/pycache/upload_and_mint.cpython-312.pyc) and (2) add pycache/ to .gitignore. Then this is ready.
|
Thanks — the IPFS/Arweave helper is useful and the tests in
None of these are blocking the concept — happy to re-review once rebased. |
…add trailing newlines - Remove committed .pyc bytecode file - Add __pycache__/ and *.pyc to .gitignore - Fix Arweave import: use arweave.arweave_lib instead of arweave - Add missing trailing newlines to Python files - Remove stale base files (foundry.toml, test/ERC721AI*) already in main
|
Thanks for the thorough review @abhicris! I've addressed all the points:
Ready for re-review! |
|
🤖 Audit verdict: PR adds legitimate off-chain weight storage helper (Python upload script + Solidity/JS tests) with no malicious payloads, credential leaks, typo-squatted deps, or access control bugs. Audited by the kcolbchain PR pipeline. See pipeline docs. |
- Replace deprecated ipfshttpclient with requests (direct IPFS HTTP API) - Fix Arweave import to use arweave_python_client correctly - Add fallback gateway upload for Arweave (no wallet required) - Remove committed bytecode (__pycache__/) - Update .gitignore for Python artifacts - Add requirements-dev.txt with correct dependencies - Rebase-ready: clean diff against main
What this does
Implements #4: off-chain weight storage with IPFS and Arweave, plus a helper script that uploads weights and mints in one flow.
tokenURI JSON Format
As specified in #4,
tokenURIpoints to JSON containing:Features
ModelMetadatadataclass with all required fieldsipfshttpclientarweave-pythontokenURI(withdata:URI fallback)CLI Usage
Tests (8 passing)
Closes #4