Posts

Showing posts with the label #passport

Blockchain Identity Example "Passport Contract" Version 2

So in this example, on top of just information, i want to be saving the Users Picture just like the passport. I should be able to retrieve this picture and be able to view it. Given that there is no specific Datatype for image. i Will be using a "Base64" string of the image. In order to see an example of this Image to String of Base64: Use this https://www.base64-image.de  Following is some Sample Outputs and images size Filesize: 8.21 KB Encoded: 10.95 KB Width: 170 px Height: 86 px Filesize: 53.60 KB Encoded: 71.47 KB Width: 511 px Height: 511 px From the samples. The bigger the image, the more KB of size, and more Ether needs to be spent. Assuming i stick to a 72x72 image Filesize: 6.68 KB Encoded: 8.91 KB Width: 72 px Height: 72 px which works fine to be saved in the block-chain for the period of the passport Validity. The new code is added in Bold pragma solidity ^0.4.0; contract passportAresh{ //Declare a struct similar to C++ ...

Blockchain Identity Example "Passport Contract"

So the basics The 1 MB size limit per Block is for the Bitcoin's blockchain. In Ethereum, there is theoretically no limit for the block size. However, blockchain is not meant for data storage and storing large documents will be very expensive. pragma solidity ^0.4.0; contract passportAresh{ //Declare a struct similar to C++ struct Passport{ string givenName; string middleName; string surname; string passportType; string countryCode; string passportNumber; string dateBirth; string nationality; string gender; string placeBirth; string dateIssue; string dateExpire; } address creator; mapping (bytes32 => Passport) AllCountryPassport; //modifier modifier onlyBy(address _account) { require(msg.sender == _account); // Do not forget the "_;"! It will // be replaced by the actual function // body when the m...