Copyright Proof-of-Creation

What it does:
Provides immutable, on-chain proof that a specific creator authored a piece of content at a specific point in time.

Why it matters:
Establishes verifiable authorship without relying on centralized copyright offices, protects creators against plagiarism, strengthens legal and commercial claims, and enables global, trustless proof of originality.

How it works:

  • Creators generate a cryptographic hash of their content (article, image, code, music, design)

  • The hash and metadata are registered on-chain via a smart contract

  • Blockchain timestamp serves as immutable proof of creation time

  • Creator’s wallet address is permanently linked to the content hash

  • No actual content is stored on-chain, preserving privacy and confidentiality

  • Anyone can later verify authorship by re-hashing the content and comparing records

  • Proof can be used for disputes, licensing, marketplaces, or legal evidence

      // SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
 * @title CopyrightProofOfCreation
 * @author Nam
 * @notice Provides immutable on-chain proof of authorship and creation time
 */
contract CopyrightProofOfCreation {

    struct Proof {
        address creator;
        uint256 timestamp;
        string metadataURI; // optional IPFS / reference link
    }

    mapping(bytes32 => Proof) public proofs;

    // -------------------- EVENTS --------------------

    event ProofRegistered(bytes32 indexed contentHash, address indexed creator, uint256 timestamp);

    // -------------------- PROOF REGISTRATION --------------------

    function registerProof(bytes32 _contentHash, string calldata _metadataURI) external {
        require(_contentHash != bytes32(0), "Invalid hash");
        require(proofs[_contentHash].timestamp == 0, "Already registered");

        proofs[_contentHash] = Proof({
            creator: msg.sender,
            timestamp: block.timestamp,
            metadataURI: _metadataURI
        });

        emit ProofRegistered(_contentHash, msg.sender, block.timestamp);
    }

    // -------------------- VERIFICATION --------------------

    function verifyProof(bytes32 _contentHash)
        external
        view
        returns (address creator, uint256 timestamp, string memory metadataURI)
    {
        Proof memory p = proofs[_contentHash];
        require(p.timestamp != 0, "Proof not found");
        return (p.creator, p.timestamp, p.metadataURI);
    }
}