Authentication overview
Steem's authentication system is fundamental to its decentralized nature, allowing users to interact with the blockchain without relying on a central authority for identity verification. Unlike traditional web applications that often employ username/password combinations or OAuth 2.0 flows, Steem utilizes a cryptographic key pair system. Every Steem account is associated with multiple public/private key pairs, each designed for specific actions and levels of control. This design ensures that transactions and interactions are cryptographically signed by the user's private key, proving ownership and intent. The public key, derived from the private key, is visible on the blockchain and used to verify signatures.Steem developer documentation.
The core principle involves client-side signing: users hold their private keys, and applications facilitate the signing of transactions locally before broadcasting them to the Steem network. This approach minimizes the risk of private key exposure to third-party services, aligning with the blockchain's emphasis on user control and security. The hierarchical structure of Steem's keys further refines this model, providing distinct permissions for different types of operations, from low-risk social interactions to high-value transfers.
Supported authentication methods
Steem primarily relies on a system of distinct private keys, each granting different levels of access and control over an account. This hierarchical key structure enhances security by compartmentalizing permissions, meaning a compromise of one key does not necessarily grant full control over an account. Developers integrate with these key types to enable specific user actions within their applications.
| Method | When to Use | Security Level |
|---|---|---|
| Owner Key (private) | Account recovery, changing other keys. Rarely used in daily operations. | Highest. Full control over the account. |
| Active Key (private) | Transferring funds, voting for witnesses, converting Steem Dollars (SBD), creating proposals. | High. Control over most financial and administrative actions. |
| Posting Key (private) | Posting, commenting, liking/disliking content, following/unfollowing accounts. | Medium. Limited to social interactions. |
| Memo Key (private) | Encrypting and decrypting private memos sent between accounts. | Low (specific to memo encryption). No transactional control. |
Applications like decentralized social media platforms often require the Posting Key for routine user interactions, while wallets and exchange services might require the Active Key for asset management. The Owner Key is typically kept offline in cold storage due to its extensive power, reserved for emergencies such as recovering a compromised account or resetting other keys.Steem API reference documentation confirms how these keys are used for various operations.
Getting your credentials
Accessing the Steem blockchain requires an account, which is created on the network rather than through a traditional signup process with a central provider. When a new Steem account is created, a set of cryptographic key pairs (Owner, Active, Posting, and Memo) is generated. These keys are unique to the account and serve as its credentials.Steem developer portal explains the account creation process.
Account Creation and Key Generation
- Through an existing Steem account: A common method is to have an existing Steem account create a new account. This process typically involves a small fee paid in Steem to cover network resources.
- Via a Steem-based application or service: Many third-party applications or wallet providers offer account creation services, abstracting some of the complexity for new users. These services will generate the keys for the user.
Key Management and Storage
Upon creation, users are provided with their private keys. It is critical to securely store these keys, as their loss means permanent loss of access to the account and its assets. There is no 'forgot password' function on a decentralized blockchain. Best practices for key storage include:
- Offline storage: For Owner and Active keys, keeping them on a hardware wallet or written down and stored securely offline is recommended.
- Password managers: Encrypted password managers can store Posting and Memo keys for easier access in applications.
- Key management services: Some Steem-based applications offer integrated key management, often using encrypted local storage or proxy signing services that require user confirmation for each transaction.
For developers, integrating with Steem SDKs like steem-js or steem-python often involves prompting users to input their private keys (typically the Posting or Active key) for specific operations. The SDKs handle the cryptographic signing process, ensuring that the private key is not exposed to the network.
Authenticated request example
Authenticating a request on Steem involves signing a transaction object with the appropriate private key. The example below demonstrates how to broadcast a simple 'vote' operation using the steem-js library, which handles the intricacies of transaction serialization and signing.
This example assumes you have an active Steem account and access to its Posting Key. The steem-js library simplifies the process of interacting with a Steem node.
const steem = require('steem');
// Set up Steem API client to connect to a Steem node
// For production, use a reliable public node or your own full node.
steem.api.setOptions({ url: 'https://api.steemit.com' });
// User credentials and transaction details
const postingKey = 'YOUR_PRIVATE_POSTING_KEY'; // Replace with a secure method of handling keys
const voter = 'your_username';
const author = 'post_author_username';
const permlink = 'post-permlink-slug';
const weight = 10000; // 100% upvote (10000 = 100%, 5000 = 50%, 0 = no vote, -10000 = 100% downvote)
// Broadcast the vote operation
steem.broadcast.vote(
postingKey,
voter,
author,
permlink,
weight,
function(err, result) {
if (err) {
console.error('Error broadcasting vote:', err);
} else {
console.log('Vote broadcasted successfully:', result);
}
}
);
In this JavaScript example:
steem.api.setOptionsconfigures the connection to a Steem API node.postingKeyis the private Posting Key of the user performing the vote. In a real application, this key should never be hardcoded or handled insecurely.voter,author,permlink, andweightdefine the parameters of the vote transaction.steem.broadcast.voteis called with these parameters. Thesteem-jslibrary takes the provided private key, constructs the vote operation, signs it cryptographically, and broadcasts it to the Steem blockchain.Steem developer documentation on broadcasting operations elaborates on this process.
Security best practices
Securing Steem applications and user accounts requires adherence to specific best practices, particularly concerning private key management and transaction handling. Given the immutable nature of blockchain transactions and the absence of central account recovery, preventing key compromise is paramount.
Private Key Management
- Never expose private keys: Private keys should never be transmitted over unencrypted channels, stored on public servers, or hardcoded into client-side applications.
- Client-side signing: All transaction signing should occur on the client side, within the user's browser or device. This ensures the private key never leaves the user's control.
- Use appropriate key types: Always use the key with the minimum necessary permissions for a given operation. For example, use the Posting Key for social interactions and reserve the Active Key for financial transactions.
- Multi-factor authentication (MFA): While Steem itself doesn't have a built-in MFA system, applications built on Steem can implement their own MFA layers, such as requiring a second device for transaction confirmation or integrating with WebAuthn/FIDO standards for stronger user verification.FIDO Alliance specifications detail such authentication mechanisms.
- Secure storage: Encourage users to store their Owner and Active keys in cold storage (e.g., hardware wallets, encrypted paper backups) and use secure password managers for other keys.
Application Security
- Input validation: Sanitize and validate all user inputs to prevent injection attacks or malformed transactions.
- Secure communication: Use HTTPS/TLS for all communication between your application and Steem nodes or other backend services to protect data in transit.
- Rate limiting: Implement rate limiting on API requests to prevent denial-of-service attacks against your application or the Steem nodes it connects to.
- Error handling: Implement robust error handling and logging to identify and respond to potential security incidents.
- Regular security audits: Conduct regular security audits of your application code, especially any parts dealing with private keys or transaction signing.
- Educate users: Provide clear guidance to users on how to secure their Steem accounts and private keys, emphasizing the importance of not sharing them and understanding the implications of different key types.
Decentralized Identity and Wallets
For enhanced user experience and security, developers often integrate with browser extensions or desktop wallets that manage Steem keys. These wallets act as secure signing agents, allowing applications to request transaction signatures without ever handling the user's private keys directly. This model aligns with the principles of decentralized identity, where users maintain sovereign control over their credentials.Mozilla Developer Network's Web Authentication API guide provides context on modern web authentication standards that contribute to such models.