Skip to content

OpstanGit/opstan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Opstan

Opstan is an independent Proof-of-Work blockchain with a decentralized social network.

The main idea of Opstan is simple: a social network should not depend on one central company, one central server, or one administrator who can silently delete public history. Opstan uses a blockchain not only for coin transfers, but also for public channels and public messages.

Public posts written into the blockchain become part of the shared history of the network. This makes Opstan useful for communities where reputation, transparency, and long-term accountability matter: developers, traders, analysts, journalists, independent bloggers, researchers, and open communities.

Official informational website: https://opstan.org
Block explorer: https://opstan.org/blocks.html
X / Twitter: https://x.com/OpstanNews


License

Opstan is released under the MIT License.

Copyright (c) 2026 Opstan Project Contributors

See the LICENSE file for the full license text.

Build

Windows

On Windows, it is recommended to build Opstan from:

x64 Native Tools Command Prompt for VS 2022

This is recommended because Opstan is a Rust project with native dependencies, and the x64 Native Tools environment provides the correct 64-bit build tools and linker.

Build command:

cargo build -p opstan --release --no-default-features --features "mainnet cli" --locked --bins

Table of contents


What Opstan is

Opstan is a full-node blockchain application.

A user can run a node, download and verify the chain, use a wallet, send coins, mine blocks, and publish public messages into public channels. Every full node independently verifies the same consensus rules.

Opstan is not a centralized website with a blockchain label. The core is a real PoW chain where blocks are mined, validated, stored, propagated, and rejected if they do not follow the rules.


Why Opstan exists

Traditional social platforms have one major weakness: public history can be changed after the fact.

A person can publish a prediction, advertisement, political statement, trading signal, or public promise, and later delete the bad parts while keeping only the successful parts. Over time, this creates fake reputation.

Opstan is designed around a different idea:

Public reputation should be built on public history that cannot be quietly rewritten.

This does not mean every message is true. It means that public records are harder to hide, erase, or manipulate later. Users can judge a channel, author, trader, analyst, or project by the full visible history, not only by selected screenshots.


Main features

  • Independent Proof-of-Work blockchain
  • Full node verification
  • Wallet with local keys
  • Coin transfers
  • Solo mining
  • Poollite mining support
  • Public channels
  • Public on-chain messages
  • Block explorer compatibility
  • P2P node synchronization
  • Mempool for pending transactions and public messages
  • GUI wallet/application
  • CLI node/application
  • Export tools for blocks and transactions
  • Payout utility for pool operators
  • Consensus safety guards for mainnet builds

Official website and information

The official informational website for Opstan is:

https://opstan.org

The website is used to present the project, explain the idea, provide public information, and link to the block explorer and official materials. It is an informational entry point for users, miners, developers, and community members.

Important: Opstan itself is not a centralized website. The website can explain the project, but the network is operated by independent nodes. A node can verify blocks, transactions, public messages, balances, and chain state locally according to the consensus rules.

Useful public links:


Important note about private messages

Private/direct messages are disabled in the official Opstan GUI and CLI build.

The current official user-facing version focuses on:

  • wallet
  • coin transfers
  • public channels
  • public on-chain messages
  • mining
  • node synchronization

The repository may still contain protocol-level structures or internal code paths related to encrypted/private message formats. They are not available as a normal user feature in the official build and should not be described to users as an active feature.

Do not present Opstan as a private messenger. The current public version should be presented as a decentralized public-channel and wallet application.


How Opstan works

Opstan works similarly to classic PoW blockchains:

  1. Nodes keep a local database of blocks and state.
  2. Miners build candidate blocks.
  3. A block is valid only if it satisfies the PoW target and consensus rules.
  4. Nodes verify received blocks independently.
  5. Invalid blocks are rejected.
  6. Valid blocks are added to the best chain.
  7. Transactions and public messages can be included in mined blocks.
  8. Public channel history can be read from the blockchain.

A normal user can simply run the GUI. A more technical user can run the CLI node, connect to peers, mine, inspect blocks, and export blockchain data.


Repository structure

.
├── Cargo.toml
├── Cargo.lock
├── build.rs
├── rust-toolchain.toml
├── assets/
│   ├── opstan.ico
│   ├── opstan_gui.rc
│   ├── opstan_icon_256.png
│   └── opstan_logo.png
└── src/
    ├── main.rs                    # CLI node/application
    ├── lib.rs                     # public crate modules
    ├── bin/
    │   ├── opstan_gui.rs          # GUI application
    │   ├── opstan_payout.rs       # payout utility
    │   └── print_consensus_lock.rs
    ├── block.rs                   # block/header types
    ├── chain.rs                   # chain validation and chain logic
    ├── consensus_lock.rs          # consensus lock/freeze check
    ├── deps_fingerprint.rs        # dependency fingerprint check
    ├── emission.rs                # block reward schedule
    ├── merkle.rs                  # merkle roots
    ├── miner.rs                   # PoW mining
    ├── p2p.rs                     # peer-to-peer networking
    ├── params.rs                  # consensus and protocol parameters
    ├── poollite_client.rs         # pool mining client
    ├── pow.rs                     # proof-of-work target/hash logic
    ├── sig.rs                     # signatures and addresses
    ├── storage.rs                 # RocksDB storage/state indexes
    ├── tx.rs                      # transactions and message types
    ├── types.rs                   # common primitive types
    ├── wallet.rs                  # wallet and keys
    └── wire.rs                    # on-chain encoding

System requirements

Recommended:

  • Rust toolchain compatible with this repository
  • Cargo
  • C++ build tools required by RocksDB
  • Enough disk space for the blockchain database
  • Stable internet connection for P2P synchronization

The repository contains rust-toolchain.toml, so rustup should automatically select the intended Rust toolchain when you build the project.

Windows

Install:

Recommended build terminal on Windows:

x64 Native Tools Command Prompt for VS 2022

Open that terminal, go to the Opstan repository folder, and run the official build command from the section below.

Linux

Typical packages:

sudo apt update
sudo apt install -y build-essential clang pkg-config libssl-dev

Then install Rust from https://rustup.rs.


Build from source

Build official release binaries

Recommended official mainnet build command:

cargo build -p opstan --release --no-default-features --features "mainnet cli" --locked --bins

This command builds the release binaries with the mainnet and cli feature set and uses Cargo.lock through --locked so dependency versions stay fixed.

On Windows, build from:

x64 Native Tools Command Prompt for VS 2022

Do not use a normal Command Prompt if the C/C++ build environment is not loaded. Some dependencies, including RocksDB-related native components, may require the Visual Studio C++ build tools environment.

This builds the main binaries, including:

target/release/opstan
target/release/opstan-gui
target/release/opstan_payout
target/release/print_consensus_lock

On Windows, the binaries are created as .exe files.

Build default development version

cargo build

Run tests

cargo test

Format code

cargo fmt

Run clippy

cargo clippy --all-targets --all-features

Run the CLI node

After building:

./target/release/opstan

On Windows:

.\target\release\opstan.exe

The CLI node opens an interactive menu. It can:

  • start P2P networking
  • connect to peers
  • show wallet address
  • show balance
  • show chain status
  • send coins
  • publish public channel messages
  • read public channels
  • start solo mining
  • start Poollite mining
  • export blocks
  • export sent transactions
  • show wallet operations

The default local database directory is:

./opstan_db

The default wallet file is:

./wallet.json

Run the GUI wallet

After building:

./target/release/opstan-gui

On Windows:

.\target\release\opstan-gui.exe

The GUI is the recommended application for normal users. It provides a visual interface for wallet operations, public channels, node status, and mining controls.


Mining

Opstan supports solo mining from the CLI.

In the CLI menu, choose:

1) Solo mining

You will be asked how many CPU threads to use.

Solo mining works by repeatedly building a candidate block and searching for a nonce that satisfies the current target. When a block is found, the node validates it locally, adds it to the chain if valid, and broadcasts it to peers.

To stop solo mining in the CLI, press:

Ctrl+C

Mining rewards are not immediately spendable. They become spendable only after coinbase maturity.

Mining and device load

Mining uses computational resources. Carefully monitor CPU load, temperature, power usage, cooling, and the overall condition of your device.

Incorrect settings, excessive thread count, poor cooling, or long operation near hardware limits may lead to overheating, reduced performance, unstable operation, or hardware wear.

Before long mining sessions, it is recommended to:

  • monitor device temperature and load;
  • use reasonable thread and power settings;
  • make sure the cooling system works properly;
  • avoid leaving the device unattended if you are not confident in its stability.

Poollite mining

The CLI also supports Poollite mining.

In the CLI menu, choose:

15) Start Poollite mining

You will be asked for:

  • pool address
  • login/account address
  • number of mining threads

You can also provide the default pool host through an environment variable:

export POOL_HOST="host:port"

On Windows PowerShell:

$env:POOL_HOST="host:port"

The payout utility is available as:

./target/release/opstan_payout --db ./opstan_db --wallet ./wallet.json --payout-file ./payout.json

Dry run:

./target/release/opstan_payout --db ./opstan_db --wallet ./wallet.json --payout-file ./payout.json --dry-run

It is recommended to run payout operations when the main node is stopped, to avoid RocksDB access conflicts.


Wallet

The wallet is local. The user is responsible for protecting the wallet file and seed phrase.

Important rules:

  • Back up your seed phrase.
  • Do not publish wallet.json.
  • Do not commit wallet.json to GitHub.
  • Do not share your seed phrase.
  • Losing the wallet/seed can mean losing access to funds.

The CLI and GUI can show balances, pending operations, confirmed operations, transfers, and mining rewards.

Opstan uses atom units internally:

1 OPST = 1,000,000,000,000,000,000 atoms

Public channels

Public channels are one of the main social features of Opstan.

A channel message contains:

  • sender address
  • channel name
  • message payload
  • fee
  • nonce
  • signature

Channel names are limited to lowercase letters and digits:

a-z, 0-9

Maximum channel name length:

32 bytes

Public messages are placed into the mempool first and then included in mined blocks.

Once included in the blockchain, a public message becomes part of the chain history.


P2P network

Opstan nodes communicate through a custom P2P layer.

The CLI full node opens a TCP P2P listener on the port selected at startup. By default, the CLI asks for a port, for example:

Which port should the node listen on? [1111]:

The node listens on that P2P port for incoming connections. If the port is open in the operating system firewall and forwarded on the router, other Opstan nodes can connect to it from the internet. If UPnP is enabled and supported by the router, the node may also try to open/map the selected port automatically.

On Windows, the firewall may ask whether to allow the Opstan executable to accept network connections. For a public node, allow the connection and make sure the chosen P2P port is reachable. For a private/local test node, keep the port closed or restrict it in the firewall.

IP address and network visibility

Opstan is a P2P network. For normal P2P operation, your IP address may be visible to the nodes you connect to. Your node address may also be shared through peer discovery, stored in peer lists, written into local node files, configuration files, or logs by other participants.

Opstan should not be presented as a network for hiding IP addresses. If hiding your IP address is important to you, use a VPN or other network-protection tools.

If port forwarding, UPnP, or manual port opening is enabled, other network participants may be able to connect to your node. If your port is closed, inbound connections are usually fewer or absent, but outbound connections may still reveal your IP address to the nodes you connect to.

The P2P layer supports:

  • peer connections
  • peer gossip
  • block propagation
  • tip exchange
  • block synchronization
  • mempool synchronization
  • inbound and outbound connection limits
  • basic rate limiting
  • self-connect prevention

Peers can be stored in:

peers.txt

Each line should contain a peer address in this format:

host:port

Example:

127.0.0.1:1111
example.com:1111
192.0.2.10:1111

For a public node, the selected P2P port must be reachable from the internet.


Consensus parameters

Some important current parameters:

Parameter Value
Target block time 600 seconds
Retarget interval 144 blocks
Retarget window 86,400 seconds
MTP window 11 blocks
Max future drift 2 hours
Coinbase maturity 100 blocks
Max block size 10 MB
Max total tx bytes per block 4 MB
Max total public message bytes per block 3 MB
Max total private-message-format bytes per block 2 MB
Mempool cap 80,000 items
Per-address mempool cap 50 items
Mempool TTL 12 blocks
Address size 32 bytes / 64 hex characters
Decimals 18

Block reward schedule:

Phase length Reward
52,560 blocks 240 OPST
210,240 blocks 120 OPST
210,240 blocks 60 OPST
210,240 blocks 30 OPST
210,240 blocks 15 OPST
210,240 blocks 8 OPST
210,240 blocks 4 OPST
210,240 blocks 2 OPST
after that 1 OPST forever

Do not change consensus-critical parameters after mainnet without a deliberate protocol upgrade/hard fork.

Consensus-critical files include:

src/params.rs
src/emission.rs
src/pow.rs
src/chain.rs
src/block.rs
src/tx.rs
src/merkle.rs
src/sig.rs
src/canonical.rs
src/wire.rs
src/types.rs

Environment variables

Useful environment variables:

Variable Purpose
OPSTAN_LOG_LEVEL Logging level: off, error, warn, info, debug, trace
OPSTAN_LOG_DIR Directory for rotating logs
POOL_HOST Default Poollite server address in CLI
OPSTAN_PEERS_FILE Path to peers file, default peers.txt
OPSTAN_PEERS_NC_FILE Path to non-connectable peers file, default peersnc.txt
OPSTAN_SELF_ADDR Force advertised public address, for example 1.2.3.4:1111
OPSTAN_UPNP Enable/disable UPnP port mapping. Example: false
OPSTAN_REQUIRE_UPNP Require UPnP success for public advertisement
OPSTAN_MAX_INBOUND Maximum inbound connections
OPSTAN_MAX_INBOUND_PER_IP Maximum inbound connections per IP
OPSTAN_MAX_OUTBOUND Maximum outbound connections
OPSTAN_CONNECT_TIMEOUT_SECS Outbound connection timeout
OPSTAN_RECONNECT_BACKOFFS Reconnect schedule, for example 30,60,120,300,3000
OPSTAN_MEMPOOL_MAX_BEHIND Skip mempool sync if too far behind peer tip
OPSTAN_MEMPOOL_SNAPSHOT_MAX_ITEMS Max mempool items per snapshot
OPSTAN_MEMPOOL_SNAPSHOT_MAX_BYTES Max mempool snapshot size

Example public node on Linux/macOS:

export OPSTAN_LOG_LEVEL=info
export OPSTAN_UPNP=true
export OPSTAN_SELF_ADDR="203.0.113.10:1111"
./target/release/opstan

Example public node on Windows PowerShell:

$env:OPSTAN_LOG_LEVEL="info"
$env:OPSTAN_UPNP="true"
$env:OPSTAN_SELF_ADDR="203.0.113.10:1111"
.\target\release\opstan.exe

If you do not want the node to try UPnP port mapping, set:

export OPSTAN_UPNP=false

On Windows PowerShell:

$env:OPSTAN_UPNP="false"

Files created at runtime

These files/directories are local runtime data and should not be committed:

opstan_db/
wallet.json
wallet.json.locked
peers.txt
peersnc.txt
log1
log2
*.log
opstan_blocks_*.json
opstan_sent_*.json
opstan_payout_latest.json
payout.json

Recommended .gitignore:

/target/
/opstan_db/
/wallet.json
/wallet.json.locked
/wallet*.json
/peers.txt
/peersnc.txt
/log1
/log2
*.log
/opstan_blocks_*.json
/opstan_sent_*.json
/opstan_payout_latest.json
/payout.json
.DS_Store
Thumbs.db
.vscode/
.idea/
*.exe
*.pdb
*.dll
*.so
*.dylib

Security notes

  • This is experimental blockchain software.
  • Do not use funds you cannot afford to lose.
  • Always back up your wallet seed phrase.
  • Never publish private keys or seed phrases.
  • Do not commit local databases or wallets to GitHub.
  • Run mainnet builds in release mode.
  • Do not enable test/legacy features for mainnet releases.
  • Review consensus changes carefully.
  • Public channel messages are public and may be stored permanently.
  • IP addresses may be visible to connected peers in normal P2P operation.
  • Use VPN or other network-protection tools if you need additional IP privacy.
  • Mining can heavily load hardware; monitor temperature, cooling, and power usage.
  • Private/direct messages are not an official user-facing feature in the current build.

Development

Print consensus lock

cargo run --release --bin print_consensus_lock

Build only the GUI

cargo build --release --bin opstan-gui

Build only the CLI

cargo build -p opstan --release --no-default-features --features "mainnet cli" --locked --bin opstan

Build payout utility

cargo build --release --bin opstan_payout

Run with logs in a separate directory

mkdir -p logs
OPSTAN_LOG_DIR=./logs OPSTAN_LOG_LEVEL=info ./target/release/opstan

Contributing

Contributions are welcome, but consensus changes must be treated carefully.

Good contribution areas:

  • documentation
  • build instructions
  • tests
  • GUI improvements
  • explorer compatibility
  • P2P stability
  • wallet UX
  • performance optimization
  • code cleanup that does not change consensus behavior

High-risk areas:

  • block format
  • transaction format
  • reward schedule
  • PoW validation
  • retarget logic
  • signature validation
  • canonical encoding
  • merkle calculations
  • state transition rules

For high-risk changes, clearly explain whether the change is consensus-changing or non-consensus-changing.


Disclaimer

Opstan is experimental software. It is provided for research, development, and community testing. Nothing in this repository is financial advice, investment advice, or a promise of exchange listing, profit, or future value.

About

Opstan is a decentralized Proof-of-Work social network with no central server and no single company controlling the network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages