deny (restricted)
Published: March 2025 | Last updated: March 2025
Overview
The deny RPC method revokes a tenant's authorization from the Lynx blockchain storage system. This command allows the blockchain manager to remove storage privileges from existing tenants, preventing them from further authentication and data storage operations. The revocation is recorded on the blockchain as a permanent record, ensuring the network consistently enforces access controls.
Syntax
deny <hash160>Description
When you invoke the deny method as the blockchain manager, the Lynx daemon creates and broadcasts a special revocation transaction that removes a tenant from the authorized list. Similar to the authorization process, this revocation is implemented as a blockchain transaction containing a timestamped payload with the tenant's identifier and a revocation flag. Once this transaction is confirmed, the specified tenant can no longer authenticate or perform storage operations.
This command is the counterpart to the allow command and completes the lifecycle management of tenant authorizations. Together, these commands provide the blockchain manager with complete control over who can utilize the blockchain storage system.
Parameters
hash160
string
Yes
The RIPEMD-160 hash of the tenant's public key in hexadecimal format. This is a 40-character hexadecimal string (e.g., 00112233445566778899aabbccddeeff00112233) that uniquely identifies the tenant to be removed.
Returns
The method returns a string indicating the result of the operation:
success- The tenant has been successfully removed from the systemhash160-wrong-size- The provided hash is not the correct length (must be 40 hexadecimal characters)Role-based restriction: Current role cannot perform this action- The authenticated user is not the blockchain managererror-generating-authpayload- An error occurred while generating the authentication payloaderror-generating-authtransaction- An error occurred while creating the authentication transactionfailure- A general failure occurred, which typically indicates an authentication problem
Access Control
The deny command has strict access control requirements:
Only the blockchain manager (initial authentication user defined in consensus parameters) can execute this command
The manager must be authenticated via the
authcommand before usingdenyRegular tenants cannot revoke access for themselves or other tenants
This role-based restriction ensures centralized control over tenant authorization management
Revocation Transaction
When a tenant's access is revoked, the system:
Generates a special authentication payload containing:
Operation type (1 for revoking a tenant, as opposed to 0 for adding)
Current timestamp
The tenant's hash160 identifier
Creates a blockchain transaction with this payload embedded as an OP_RETURN output
Broadcasts this transaction to the network, where it will be mined into a block
This transaction serves as a permanent, immutable record of tenant revocation that all nodes can verify.
Examples
Revoke a tenant's access
As the blockchain manager:
Output:
Using JSON-RPC:
Error Handling
The method will return a failure message in the following scenarios:
The provided hash160 is not exactly 40 characters long (20 bytes in hexadecimal)
The user is not authenticated or is not authenticated as the blockchain manager
There is an error in generating the authentication payload or transaction
The authentication system cannot validate the current user's credentials
Implementation Notes
The command verifies the user's authentication status using the
is_auth_memberfunctionIt validates that the authenticated user is the blockchain manager using consensus parameters
The operation type is set to 1 (for revocation), as opposed to 0 (for authorization)
The current timestamp is obtained using
TicksSinceEpoch<std::chrono::seconds>(GetAdjustedTime())The authentication payload is generated with the
generate_auth_payloadfunctionThe authentication transaction is created and broadcast with the
generate_auth_transactionfunctionUnlike the
allowcommand which returns an array, this command returns a simple string response
Tenant Access After Revocation
When a tenant's access is revoked:
The tenant can no longer authenticate using the
authcommandAny existing authentication sessions will continue until they expire (approximately 6 hours)
Existing files stored by the tenant remain on the blockchain and can still be retrieved
The tenant will no longer appear in the list returned by the
tenantscommand
This behavior ensures that revocation prevents future access while preserving existing data integrity.
Last updated
