hackquest logo

TimeCapsule

A blockchain-based Time Capsule smart contract that securely locks messages or tokens until a specified future date, ensuring tamper-proof and time-locked access on the Ethereum network.

Description

Project Title

Time Capsule Smart Contract


Project Overview

The Time Capsule Contract is an Ethereum-based smart contract designed to lock messages or tokens until a specified future date. Once the unlock time is reached, the stored content can be accessed by the user.

This concept replicates a “time capsule” in the blockchain environment, ensuring data or tokens remain secure and inaccessible until a predetermined unlock date.


Project Idea

Prompt: “Create a time capsule that unlocks on a specific date.”

The objective of this project is to enable users to:

  • Lock personal messages or digital content until a chosen future time.

  • Securely store tokens that can only be withdrawn after the unlock date.

  • Utilize blockchain technology to ensure a tamper-proof and trustless time-lock mechanism.

Possible Use Cases:

  • Sending a message to oneself or another person in the future.

  • Scheduling the release of digital assets or rewards.

  • Creating commitments, digital wills, or long-term vaults for data or funds.


Features

  • Lock messages or ERC-20 tokens securely.

  • Specify an exact unlock time using a UNIX timestamp.

  • Retrieve messages or tokens only after the unlock time.

  • Fully transparent and verifiable on the blockchain.


Smart Contract Details

Contract Address:

Network: Ethereum (Testnet/Mainnet as applicable)

Main Functions (Example):

  • createCapsule(string memory message, uint unlockTime) – Locks a message until the specified time.

  • viewCapsule() – Retrieves the message once the unlock time has passed.

  • lockTokens(address token, uint amount, uint unlockTime) – Locks ERC-20 tokens until a future date.

  • withdrawTokens() – Allows the user to withdraw locked tokens after the unlock time.


How to Use

  1. Deploy or interact with the smart contract using Remix, Hardhat, or another Ethereum development environment.

  2. Call the createCapsule() function and provide the message and unlock timestamp.

  3. Wait until the unlock date is reached.

  4. Retrieve the locked content using the appropriate function (e.g., viewCapsule()).


Future Enhancements

  • Integration with NFT and digital file storage.

  • User interface (DApp) for easier interaction.

  • Notification system for capsule unlock events.

Tech Stack

Solidity
Web3
Ethers
Team Leader
TTanushree
Sector
Other