Manage accounts, enable fast payments.
-
Network
- Services
- Information
-
About
Use the Hedera File Service to anchor external data to the transparent public ledger. Examples of external data could be a hash to a document or database. The file service is purpose built to manage credentials and to verify that data existed at a certain time with a fair timestamp.
Collaborate between parties with shared data records for more efficient data reconciliation and processes using verified signatures and consensus timestamps.
Manage a write access control list to define ownership of files with advanced key structures.
When granting access to someone, you often need to revoke access, too; like an employee's access to a building. Accounts on Hedera can have livehashes to establish an instantly verifiable and revokable claim.
A file can be deleted by its owner, e.g. to comply with regulatory requirements, and afterwards, a state proof can prove to third parties that it was deleted.
Cost effectively manage large documents by creating a file containing a hash that acts as a pointer to an off-ledger document stored in the cloud.
Hedera File Service distributes your file to each node in the Hedera network, ensuring high availability and reliability.
The Hedera File Service API provides the ability to manage files and their content, control access, and verify their owners.
//Create a file owned by your account
var tx = new FileCreateTransaction(client).setExpirationTime(
Instant.now()
.plus(Duration.ofSeconds(2592000))
)
.addKey(operatorKey.getPublicKey())
.setContents(fileContents);
var receipt = tx.executeForReceipt();
var newFileId = Objects.requireNonNull(receipt.getFileId());
// Get file contents
var contents = new FileContentsQuery(client)
.setFileId(newFile.getFileId())
.execute();
System.out.println("File content query results: " + contents.getFileContents().getContents().toStringUtf8())
//Delete file owned by operator key
TransactionReceipt txDeleteReceipt = new FileDeleteTransaction(client)
.setFileId(newFileId)
.executeForReceipt();
if (txDeleteReceipt.getStatus() != ResponseCodeEnum.SUCCESS) {
System.out.println("Error while deleting a file");
return;
}
System.out.println("File deleted successfully.");
Oliver Bolton
CEO, CO-FOUNDER
With secure access and transparent file details, you can add a new level of trust to signed files. This is well suited to manage access and credentials, like a drivers license.
Add a file containing a hash of a credential to the public. For example, a city office uploads a citizen's driver license.
The file has the keys of both the driver and the city official attached to it. Both must sign to create the file, but either can sign to delete the file; in this case if the license expires or has too many points.
Owners can optionally provide file details and prove the file existed at a point in time. This can be checked by insurance providers, employers, and more.