An implementation of the FingerChain media-sharing system from Xiao et al., "FingerChain: Copyrighted Multi-Owner Media Sharing by Introducing Asymmetric Fingerprinting Into Blockchain" (IEEE TNSM, 2023). This implements secure media sharing for one owner and one user using Hyperledger Fabric, IPFS, and user-side fingerprinting.
FingerChain enables secure media sharing (e.g., music, videos) with copyright protection. It uses:
- Hyperledger Fabric: Blockchain for tracking ownership and access.
- IPFS: Decentralized storage for media.
- Asymmetric Fingerprinting: Adds a unique user ID (
b_k
) to media for piracy tracing.
This implementation demonstrates the workflow: an owner registers, uploads media to IPFS, shares it with a user, who adds a fingerprint, which can be traced if shared illegally. Visuals (workflow flowchart, fingerprint plot) are generated by included scripts.
- Deploy Fabric network and chaincode.
- Register owner (
owner1
). - Upload media to IPFS, store hash on Fabric.
- Register user (
user1
). - Share media with user.
- Add fingerprint (
b_k
, e.g.,[1 1 1 1 0 1 1 1 0 1]
) to user’s copy. - Trace fingerprint to identify user.
- Hyperledger Fabric: Blockchain ledger.
- IPFS: Decentralized storage.
- Node.js: Client logic (
client/app.js
). - Python: Fingerprinting (
scripts/fingerprinting.py
), graphs (scripts/workflow_graph.py
,scripts/fingerprint_graph.py
). - Go: Chaincode (
chaincode/chaincode.go
). - Paillier Encryption: Secure fingerprinting.
fabric-commands.sh
: Starts Fabric, deploys chaincode.client/app.js
: Registers owner/user, uploads/shares media.client/package.json
: Node.js dependencies.scripts/ipfs_utils.py
: Manages IPFS storage.scripts/fingerprinting.py
: Generates/traces fingerprint.scripts/workflow_graph.py
: Creates workflow flowchart.scripts/fingerprint_graph.py
: Plots fingerprint.chaincode/chaincode.go
: Smart contract..gitignore
: Excludes dependencies.LICENSE
: MIT license.
- macOS (Linux compatible).
- Tools:
brew install node python3 graphviz go
- IPFS:
brew install ipfs ipfs init # First time only
- Hyperledger Fabric:
curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.5.0 mv fabric-samples ~/fabric-samples cd ~/fabric-samples git checkout v2.5.0
# Node.js (in FingerChain/client/)
cd client
npm install
# Python (in FingerChain/scripts/)
pip3 install ipfshttpclient numpy phe matplotlib graphviz
- Clone this repo:
git clone https://github.com/your-username/FingerChain.git cd FingerChain
- Ensure
~/fabric-samples/test-network
exists (from Fabric install). - Create wallet:
mkdir client/wallet cd ~/fabric-samples/test-network ./network.sh up node enrollAdmin.js cp -r wallet/* ~/FingerChain/client/wallet/ ./network.sh down
-
Start Fabric and IPFS:
bash fabric-commands.sh
- In another terminal:
ipfs daemon
- In another terminal:
-
Run Client:
cd client node app.js
-
Run Scripts:
cd scripts python3 ipfs_utils.py python3 fingerprinting.py
-
Generate Visuals:
cd scripts python3 workflow_graph.py python3 fingerprint_graph.py mv *.png ../
app.js
:Owner registered Media uploaded with hash: QmbnnDCg6zz... Media shared
ipfs_utils.py
:IPFS Hash: QmX2Dr...
fingerprinting.py
:Original fingerprint: [1 1 1 1 0 1 1 1 0 1]
MIT License. See LICENSE
.