Overview
Theweb3 namespace provides utility methods for client version information and cryptographic operations.
Methods
web3_clientVersion
Returns the current client version.string
Client name and version information
- Client name (Viction)
- Version number (v2.3.0-stable)
- Operating system (linux-amd64)
- Go version (go1.19.5)
web3_sha3
Returns Keccak-256 (not the standardized SHA3-256) hash of the given data.string
required
Data to hash (must be hex encoded with “0x” prefix)
string
Keccak-256 hash of the input data (32 bytes, hex encoded)
Despite the name “sha3”, this method uses Keccak-256, which is what Ethereum and Viction use for hashing. This is different from the final SHA3-256 standard.
Usage Examples
JavaScript (Web3.js)
JavaScript (Ethers.js)
Python (Web3.py)
Common Use Cases
Client Version Checking
Data Hashing for Verification
Creating Deterministic Identifiers
Keccak-256 Details
What is Keccak-256?
Keccak-256 is the cryptographic hash function used in Ethereum and Viction for:- Address generation: Creating addresses from public keys
- Transaction hashing: Generating unique transaction identifiers
- Storage keys: Computing storage slot locations
- Merkle trees: Building block headers and state tries
- Message signing: Hashing messages before signature
Properties
Deterministic
Same input always produces same output
One-way
Computationally infeasible to reverse
Collision Resistant
Hard to find two inputs with same hash
Fixed Size
Always produces 32-byte (256-bit) output
Hash Collision
Security Considerations
Input Encoding
Always ensure data is properly hex encoded:Use Web3 Libraries
For production applications, use established libraries rather than callingweb3_sha3 directly:
Related Methods
eth_sign
Sign messages using account private keys
net_version
Get network version information