Get Started. Develop on MaataData's blockchain.
Last updated
Last updated
MaataData’s blockchain can be used for the development of applications that require robust computing and storage functionalities like database, file storage, messages, payments, legal contracts and more, where each transaction needs to be signed and secured, and related files need to be encrypted and easily stored in the same blockchain layer.
Here is an example of a simple HTML/Javascript API that can be used to integrate with the MaataData blockchain.
The basesapi.js file is the base security API to interface with the blockchain. This interface contains all the encryption, signing, storage and integrated database functions you need to interact with the blockchain.
The script basesapi.js is loaded in line 3.
The loadfirst function is executed on loading the api.html from a browser with the URL
The IP address is set in line 7.
Basic initialization is done through fs.initapi(IP address) function in line 9.
The private-public key for an account is generated from a user’s password through the fs.dbkey(‘password’) function in line 11.
To write information, i.e. any data to the blockchain, you would use the fs.recordput function like in line 12.
With the user account’s private-public key, data is signed and encrypted in the browser or on their device before sending it to the blockchain.
The function has multiple parameters to attached files like sending data to another public address.
To retrieve data from the blockchain the fs.recordget function is use like in line 15.
The account’s private-public key is used to decrypt the retrieved data.
The data field can be an object with multiple fields. In the this example, the key ‘john’ call up the record of data.
A file and the file’s content can be added to the data. File types include pdf, docx, txt, mp3, mp4, png, and jpg.
In line 9, the file content is retrieved.
For sending messages, contracts or payments, information can be sent to the receiving user’s public address.
The receiving user’s public address is used to encrypt the data which the receiving user with its private key can decrypt.