Skip to content

kotagit75/bitclock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

369 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitClock

BitClock is a distributed timestamp system without requiring consensus. Each node generates and shares stamps, which are then compiled into a proof, allowing the order in which the data was generated to be verified.

License Rust test status

boot_log

Note

BitClock is currently in active development. The API and features may change without notice.

✨ Features

  • 🔒 Instant finality - A proof is finalized once it is validated by the network and cannot be reversed.
  • 🏎️ No consensus required - Timestamps can be issued without consensus.
  • 🕰️ Distributed timestamp without ledger - We can verify timestamp without global ledgers or blockchains.
  • Fast timestamp creation - Once you've collected a certain number of stamps, you can create a proof right away.

🛡️ Attack Resistance

BitClock requires a certain amount of computational work via Proof of Work to generate timestamps and uses a Verifiable Delay Function (VDF) to ensure a fixed delay. This makes the system resistant to Sybil attacks.

🎯 Use case

Digital Certificates

With BitClock, you can not only create digital certificates but also prove their order.

🕓 Time sequence

BitClock does not have a global clock. Instead, each node maintains a counter that serves as its local time, and the timeline is determined by observing changes in these counters. This timeline determination is performed by compare_time.

📚 Documents

🚀 Getting Started

1.Installation

# Clone the repository (or Download ZIP)
$ git clone https://github.com/kotagit75/bitclock.git

# Navigate to the project directory
$ cd bitclock

# build
$ cargo build --release

2.Simple Example

4.Usage

# run
$ ./target/release/bitclock bitclock

# get status
$ curl http://localhost:8080/status

# add peer
$ ./target/release/cli addpeer '[peer_ip_address]'

# create proof
$ ./target/release/cli proof '[recipient]' '[content]'

# get state(address, secret_key, pool, peers)
$ ./target/release/cli state

# get address
$ ./target/release/cli address

# get pool
$ ./target/release/cli pool

# get peers
$ ./target/release/cli peers

# find proof by secret key
$ ./target/release/cli find '[secret_key]'

# verify proof
$ ./target/release/cli verify '[proof]'

# compare the issuance times of the two proofs
$ ./target/release/cli compare '[secret_key1]' '[secret_key2]'

# sort proofs by time
$ ./target/release/cli sort

# display help
$ ./target/release/bitclock -h
Usage: bitclock [OPTIONS]

Options:
  -l, --level <LEVEL>        [default: INFO]
  -h, --help                 Print help

Caution

Never make the node directory or any files within it publicly accessible. Doing so could result in the leakage of your private key.

🧩 APIs

Users can control BitClock via an HTTP server.

implemented method endpoint feature
POST / execute command
GET /status get status
GET /query get state
GET /query/address get address
GET /query/pool get proof pool
GET /query/peers get peers
GET /query/compare compare the issuance times of the two proofs
GET /query/sort sort proofs by time

Commands that can be executed at the / endpoint

  • Add a peer - Post a request with {"AddPeer": "peerIP"} in the body
  • Create proof - Post a request with {"Proof": "some data"} in the body

🎫 License

BitClock is under the MIT License.

About

⌛ A distributed system that proves "which came first" without requiring consensus.

Topics

Resources

License

Stars

Watchers

Forks

Contributors