Verifiable time-stamping and ordering of events for any web2 or web3 application.
Hedera Consensus Service (HCS) is a purpose-built tool for creating decentralized, auditable logs of immutable and timestamped events for web2 and web3 applications. Messages are submitted to the Hedera network for consensus, given a trusted timestamp, and fairly ordered. HCS is used by applications in production to track provenance across supply chains, log asset transfers between blockchain networks, count votes in a DAO, monitor IoT devices, and more.
Combine the trust of Hedera’s public network with the privacy of a permissioned blockchain framework. Build applications that require privacy for sensitive data, public trust, and auditability.
Take advantage of Hedera’s high transaction throughout, fast finality, trusted timestamps, and security. Build decentralized applications never before possible.
A single HCS message costs $0.0001 USD, whether you’re using it standalone or in conjunction with a permissioned blockchain. You only pay for messages you submit.
Build your application using any development language. Set up your environment, create a topic, and submit your first message in no time.
Business and consumer applications today rely on expensive intermediaries to facilitate trust between parties for sharing data, transacting value, and meeting regulatory compliance. Hedera Consensus Service (HCS) delivers decentralized trust for any new or existing application, across nearly every industry. Applications which benefit most from HCS require high-throughput, trusted timestamps and ordering, and fast finality. HCS also allows you to encrypt the content of sensitive messages for additional privacy.
James Dunthorne CEO
Permissioned blockchain frameworks today, such as Hyperledger Fabric or R3’s Corda, rely on moderation, matching, and ordering performed by custom-built and deployed consensus engines, such as Kafka or Raft. These services are prone to network outage, at risk of collusion by a small number of parties, and subject to the cost models of centralized infrastructure providers.HCS combines the trust of Hedera’s public network, with the privacy of permissioned blockchain frameworks. It enables verifiable timestamps, decentralized ordering, and privacy for sensitive information, for enterprise applications and consortiums.
John Jaeger CEO
A topic is created to manage the stream of messages for one application, such as a market where people bid on products.
When an event happens – like a bid – it can be sent as an encrypted message to the topic.
All of the messages are put into consensus order by the Hedera mainnet. A mirrornet can then send the messages for a particular topic to the application for processing.
When an audit needs to be conducted, previous messages can be checked, along with a state proof that ensures they have not been falsified.
Hedera's fee schedule is set by the Hedera Governing Council and always based in USD — making development costs easy to predict and estimate. You can estimate fees on Hedera using the fee calculator.
*Hedera does not guarantee the accuracy of the fees on this page. You understand that You are solely responsible for payment of any actual fees charged to the account by the Hedera Network and Hedera will not be responsible for any discrepancies in the fees estimated and the actual fees charged.
Topics make it simple to organize transactions, so each application only receives the messages it needs.
Messages are put into consensus order and given a timestamp by the Hedera network, with cryptographic proofs, so they are as trustworthy as the full Hedera network.
Messages are cryptographically tied together with a running hash to provide an auditable, tamper-proof log of history.
Message processing and storage are kept outside the Hedera network. This allows higher speed and scalability.
The high speed and good scaling ensure low, micropayment fees on par with Hedera Cryptocurrency.
The Hedera Consensus Service ensures speed and security are kept on the ledger while storage is kept off-ledger. Choose to keep everything, nothing, or anything in between.
Use the Hedera Consensus Service API to start building applications which take advantage of the high-throughput, fair ordering, and fast finality of Hedera.
Function
const { TopicCreateTransaction } = require("@hashgraph/sdk"); // Create a new public topic let txResponse = await new TopicCreateTransaction().execute(client); // Grab the topic ID let receipt = await txResponse.getReceipt(client); let topicId = receipt.topicId; console.log(`Your topic ID is: ${topicId}`); // Console: Your topic ID is: 0.0.114920
const { TopicCreateTransaction } = require("@hashgraph/sdk");
// Create a new public topic
let txResponse = await new TopicCreateTransaction().execute(client);
// Grab the topic ID
let receipt = await txResponse.getReceipt(client);
let topicId = receipt.topicId;
console.log(`Your topic ID is: ${topicId}`);
// Console: Your topic ID is: 0.0.114920
const { TopicMessageSubmitTransaction } = require("@hashgraph/sdk"); // Submit a message let sendResponse = await new TopicMessageSubmitTransaction({ topicId: topicId, message: "Hello, HCS!" }).execute(client);
const { TopicMessageSubmitTransaction } = require("@hashgraph/sdk");
// Submit a message
let sendResponse = await new TopicMessageSubmitTransaction({
topicId: topicId,
message: "Hello, HCS!"
}).execute(client);
const { TopicMessageQuery } = require("@hashgraph/sdk"); // Subscribe to the topic new TopicMessageQuery() .setTopicId(topicId) .subscribe(client, (message) => { let messageAsString = Buffer.from(message.contents, "utf8").toString(); console.log( `Sequence number: ${message.sequenceNumber} - ${messageAsString}` ) })
const { TopicMessageQuery } = require("@hashgraph/sdk");
// Subscribe to the topic
new TopicMessageQuery()
.setTopicId(topicId)
.subscribe(client, (message) => {
let messageAsString = Buffer.from(message.contents, "utf8").toString();
console.log(
`Sequence number: ${message.sequenceNumber} - ${messageAsString}`
)
})
From ideation to building your application, check out these Hedera Consensus Service resources to help you along your journey.
Learn about the web2 and web3 applications using the Hedera Consensus Service in production today.
The Hedera Consensus Service synchronizes the fair order of messages for distributed systems without relying on a centralized clock.
An open source demo of payment settlement tracking with Hedera Consensus Service.
The Pluggable HCS Lab demonstrates the ability of a Hyperledger Fabric network to connect to the Hedera Consensus Service running on a publicly accessible testnet.
This library provides an implementation of a Notary Service for the Corda distributed ledger platform using the Hedera Consensus Service (HCS).
In this tutorial, you will create a Hyperledger Fabric network that leverages the Hedera Consensus Service Fabric plug-in to use Hedera as the ordering service via the first-network sample.
This demo marries Corda with Hedera via the Hedera Consensus Service, providing double-spend checks by submitting transaction spends to HCS and ordering them with other spends on the same network.
Build, deploy, or access ESG solutions that take full advantage of Hedera's low energy network, with world class governance.
Explore other Hedera network services to run powerful smart contracts and manage files.
Create your own token or NFT
Mint and manage fungible and non-fungible tokens on Hedera for application payments, governance, or digital collectibles.
Run Solidity smart contracts
Deploy smart contracts in popular languages including Solidity and Vyper to create decentralized applications and protocols.
Hedera's cryptocurrency
Use hbars, the Hedera network's native cryptocurrency, in smart contracts for collateral, staking, and other use cases.
Ready to start building?