How to get pdf files in Solidity? - project

I'm making a student management system project in Blockchain, where I use solidity to develop it.
I want to add transcripts, certificates by the owner. So how do I get pdf files in solidity and how to verify it?
Also, how can I share this with another owner in the node?

You cannot really get pdf from solidity or store them on blockchain. Following are the ways you can solve your problem:
Generate a sha256 hash for the pdf and upload that hash onto the chain. Whenever someone wants to verify if they have the correct pdf, they just check the hash of the pdf is correct.(recommend)
Create an external service on web servers(Oracle) that verifies the pdf and pushes the result to blockchain. Whenever someone wants to verify the pdf, they upload the link to smart contract, external service is monitoring that contract for new transactions. Whenever one arrives they pick up link, verify the pdf and push the results to the smart contract which update the state of that pdf file

Related

How to get api id and hash for telegram from .session file?

I use a software for scrapping telegram members from groups. The software requires a phone number, api id and hash. I have .session file, but I can't add this file into software, it doesn't work like that. I need to write api id and hash manually.
I use MacOS. Is it possible to extract datas from this file? Or to open this session file in telegram app, to receive a code?

Verify user is owner of an NFT via MetaMask connection? Make sure connected users public eth address is the same as of the NFT?

I need to verify on my own domain/server the user which has connected his MetaMask wallet is the owner of a specific NFT in order to allow him special functions? Basically, I want to give the user access to an area that only the owner of this NFS would have.
My original NFT is sold in opensea but I can't use the opensea hidden-area option to just give the user a hidden password since the next owner (after reselling) and the old owner would have the same password and old owners could still access like this. But I need that only the current owner has access.
My user/visiter can already connect with MetaMask at my own domain and I get the public ETH address of the active account but since this is only javascript and my backend is PHP I can't just post the MetaMask info to my PHP backend since this would be easy to trick/hack.
How can I make sure the current connected MetaMask Account is the same as the NFT owner (which I know) and allow to access a URL only for this user?
My current state is that the user connects his MetaMask and I use opensea API to check who is currently the owner of the NFT. I can compare both eth addresses but the flaw in this is obviously that I use ajax to send the MetaMask public address to my backend which is only for testing since this is of course zero save!
Thank you in advance for any idea, help, tip I can get.
PS: My backend is PHP
After hours and days of researching, I found a solution that works for me.
Here are the needed steps.
Use the MetaMask API to let the user connect with your site. This is pretty easy and good explained in the MetaMask API.
Once you want to verify the MetaMask owner is the legit owner of an NFT you need first query OpenSea (or another place) the current owner of the NFT. In my case, I use the OpenSea API for my specific NFTs. Once you got the owner you are ready to verify.
On your site you need to ask the user to sign a custom message with MetaMask. There are different options to do that. More about this here: MetaMask Signing. I send for example a short text message with a unique code that I first created in my PHP Backend. Doing that I also save the code and custom message into my MySQL.
Once the user has signed you get the signing code which you can send back to your PHP backend via ajax etc. without a problem. Only the owner of the Account which you requested in the signing code is able to sign with the correct account.
Once you got the signing code in your PHP Backend you can use Fast Elliptic Curve Cryptography in PHP and php-ecrecover to check the code against the unique code you created before and the message the user signed. As a response, you get the Signer Account ETH Address and you are ready to compare. If the Signers ETH Address is the same as the NFT owner you are ready to go and you can consider the signer the owner of the NFT.
I believe this is safe to use but I am not an expert on that. In my case, this only authorize an NFT owner for a certain closed area in my community page and there are not really high risks involved but maybe somebody raises some security thoughts on that. However, I found that other NFT pages and even Opensea work similarly.
I hope this points someone in the right direction, I lost quite some time figuring this out because most solutions are Node.js etc. but not with PHP backends.

In-App Payment, is it possible to save a list of user's credit card in Android App

I'm trying to build up an android platform that takes in user credit card info and charge it on use without inserting the credit card details after saving one. But I don't seem to actually see any possible work ways in the "In-App Payment" SDK and I think I see it under Square's java SDK. But as researched in github, their official reply is that I'm unable to use java SDK in android app.
So I'm trying to figure out has anyone done this before or face the same issue?
In-App Payments SDK is solely meant for generating a card nonce on your mobile application. All other API endpoints must be done on a server or service due to security reasons (you don't want to store your personal access token within your application). Once you have that nonce, you need a server or service running that your mobile application will talk to. Ie the most basic is passing the nonce to the Charge endpoint to charge a customer.
On that same note, we have another endpoint called CreateCustomerCard, which you can pass the nonce as well as customer_id to in order to save the card to this particular customer's profile. So, at the very least you'll need to create a customer in order to have their id.
For info around saving cards on file, see this post: Hot to generate card nonce for repeated transactions without making users to enter card details?

PrestaShop migrate clients info to OpenCart

I'm trying to move the clients database from PrestaShop to OpenCart. In this endeavor I found that there are some sites which can automate this process but at a fairly high price for what I need.
I just have 200 or so clients and if I can't find a way of exporting their login details to OpenCart I will do them manually but hopefully someone can point me in the right direction, so is there a free or cheap way which would allow me to transfer the clients details to the new platform?
The trouble I'm having is getting the password of my customers, if I could get that then I could manually transfer them to the new site.
You can't get the passwords of your clients directly, because they are encrypted. What you can do is to import them as they are and change the way OpenCart decrypts them.
PrestaShop is using the following encryption:
md5(concat(_COOKIE_KEY_, 'CUSTOMER_PASSWORD'))
i.e. concatenated "key" and "password"
where _COOKIE_KEY_ is a constant from /config/settings.php
In OpenCart the change must be done in the following file:
\admin\model\user\user.php
The other ways is just to let it as it is and your customers will reset their passwords via the "Forgot Password" functionality. You can also send them emails, informing them about that switch of the software.

box.com's API to send documents for signers (through RightSignagure integration)

Provided that we have added the rightsignature app to box.com and that we have created the corresponding templates and stored them in box.com, one can send such documents from box.com to the signer through box.com's web interface. This will sign it and send it back to box.com.
I would like to know if we can do this through box.com's API rather than from RightSignature's. I can guess I can't but just wonder.
Thanks.
The Box API currently does not have an official API to work with RightSignature programmatically. The RightSignature integration is what we call a File Action (http://developers.box.net/BoxPlatformUserExperience). We do not yet have APIs that would let applications access those actions through Box.
Since we're continuing to enhance the API, feel free to email us at api [at] box [dot] com to discuss your interest in this API further.