Blockchain Diary
A simple onchain diary built entirely in Solidity no imports, no constructors.Users can timestamp and store diary entries directly on the blockchain ensuring permanence, transparency, and authenticity
Sự miêu tả
Blockchain Diary
A simple on-chain diary built entirely in Solidity — no imports, no constructors.
Users can timestamp and store diary entries directly on the blockchain, ensuring permanence, transparency, and authenticity.
🌍 Overview
Blockchain Diary enables users to record diary entries on-chain, permanently tied to their Ethereum wallet address.
Each entry automatically receives a blockchain timestamp (block.timestamp) and remains immutable once stored.
The contract is designed to be:
Minimalistic: no external dependencies or complex logic
Transparent: anyone can verify entries on-chain
Immutable: no editing or deletion for historical integrity
⚙️ Features
✅ 100% Solidity — no imports, no constructors
✅ Timestamped entries for each Ethereum address
✅ Gas-optimized logging using events
✅ Option to emit lightweight notes without storage
✅ View entries, total count, or specific user ranges
✅ Tamper-proof and verifiable on-chain history
🧠 Smart Contract Details
Name:
BlockchainDiaryCompiler Version:
^0.8.19License: MIT
Deployed Address:
0x4230E95d23Ce7adb4d692f1c3c56094FED7a89e9Network: Any EVM-compatible blockchain (Ethereum, Polygon, BSC, etc.)
🚀 Deployment Guide
🧩 Using Remix IDE
Open Remix Ethereum IDE
Create a new file
BlockchainDiary.solPaste the contract code
Select Solidity Compiler 0.8.19
Compile the contract
Under Deploy & Run Transactions, choose:
Remix VM (local testing), or
Injected Provider (MetaMask) for live networks
Click Deploy
Copy and save the Contract Address
💡 Usage
➕ Add a Diary Entry
Users can store text (plain, encrypted, or IPFS CID).
Each entry is recorded with:
msg.sender→ your Ethereum addressblock.timestamp→ exact time of submission
Example use cases:
Daily journaling on-chain
Immutable proof of statements or creative ideas
Timestamped academic notes or digital art entries
🔍 Retrieve Data
entriesCount(address)→ Get total number of entries for a usergetEntry(address, index)→ Fetch specific entry and timestampgetMyLastEntry()→ Get your most recent diary entrygetEntriesRange(address, start, end)→ Fetch multiple entriesentryContentHash(address, index)→ Verify entry integrity withkeccak256hashaddEventNote(string note)→ Emit quick note event without storing data
🪄 Example Use Cases
Personal blockchain diary or journal
Permanent storage of quotes, achievements, or thoughts
Timestamped proof of authorship or digital creation
Transparent logging for research or documentation
Off-chain integration using event logs and hashes
⚠️ Important Notes
All on-chain data is public. Avoid posting private or sensitive content directly.
For privacy, store encrypted text or IPFS hashes instead of raw text.
String storage increases gas cost — prefer shorter entries or note events.
Entries cannot be modified or deleted once created.
🧑💻 Project Information
Field | Details |
|---|---|
Project Name | Blockchain Diary |
Author | Ustaad Ustaad |
Contract ID |
|
Language | Solidity |
Compiler | 0.8.19 |
Network | Any EVM-compatible blockchain |
License | MIT |
📬 License
This project is licensed under the MIT License.
You are free to use, modify, and distribute the code with proper credit to the author.
Tiến độ hackathon
50%