NFT Professional Credentials
Author
Joan Soler-Vidal
Title
NFT Professional Credentials
Description
https://community.wolfram.com/groups/-/m/t/2313561
Category
Essays, Posts & Presentations
Keywords
Blockchain technology, NFT
URL
http://www.notebookarchive.org/2021-07-6gxysqt/
DOI
https://notebookarchive.org/2021-07-6gxysqt
Date Added
2021-07-14
Date Last Modified
2021-07-14
File Size
0.58 megabytes
Supplements
Rights
Redistribution rights reserved



WOLFRAM SUMMER SCHOOL 2021
NFT Professional Credentials
NFT Professional Credentials
Joan Soler-Vidal
FIDMAG Research Foundation
University of Barcelona
University of Barcelona
Creating a false academic credential is a very easy process that, nowadays, anyone can do. Educational institutions are not combating this fraud nor employers are doing any effort to proof that the academic credential of the employee is trustworthy or not, and so, this process is based on ethics and confidence between all parts. Blockchain Technology can give a solution to this problem by using Non-Fungible Token as Credentials that can have the same data as conventional Credentials (full name of the receiver, full name of the institution...) This project proposes using NFTs as computational artifacts to store and verify professional credentials. The projects focuses on designing a framework with a backend and client components. The project uses the MintNFT function to create the NFTs and metadata, as well as the WL blockchain function. It will use ARK Blockchain.
Student
Student
Functions
Functions
Each student needs a Pair of Keys (Private and Public) that in this project, are stored in each Student Wolfram Cloud, and an Address.
To generate the Keys, we use “GenerateAsymmetricKeyPair” function and to create an Address from these keys, we use “BlockchainKeyEncodeFunction”.
To generate the Keys, we use “GenerateAsymmetricKeyPair” function and to create an Address from these keys, we use “BlockchainKeyEncodeFunction”.
In[]:=
generateStudentKeys["ARK"]:=GenerateAsymmetricKeyPair["ARK"];
In[]:=
saveKeysToCloud[keys_,base_:"NFTCertificateKeys"]:=CloudPut[keys,URLBuild[{base,"studentKeys"}]]
In[]:=
createAddress[keys_,blockchainBase_]:=BlockchainKeyEncode[keys["PublicKey"],"Address",BlockchainBaseblockchainBase]
Data
Data
We use “CloudDeploy” function to create a website from which each student will be able to get his/her keys easily.
◼
Full Name
CloudDeploy[FormPage[{"Name","Full Name"}->"String",Module[{keys=generateStudentKeys["ARK"],address},saveKeysToCloud[keys];address=createAddress[keys,{"ARK","Devnet"}];"Your address is: "<>address]&,AppearanceRules<|"Title""Get your ARK devnet address","Description""Please provide your full name and click the Submit button to get an address.<BR><BR>Copy your address to be used when receiving an NFT certificate."|>],"SummerSchoolProject/AddressCreationProcess"]
◼
Next image is a Screen capture of the process of getting an Address completed:
Issuer (Minter)
Issuer (Minter)
The issuer is in this case would be Wolfram institution.
Functions
Functions
Server
Server
Wolfram institution also needs a pair of keys created with the function “GenerateAsymmetricKeyPair”.
In[]:=
arkKeys=GenerateAsymmetricKeyPair["ARK"];
◼
Certificate Metadata
createCertificateMetadata[studentName_,studentAddress_,"ARK"]:=Module[{keys=CloudGet[CloudObject[
https://www.wolframcloud.com/obj/christianp/NFTCertificateServer/keys/ARK
]]},<|"StudentName"->studentName,"StudentAddress"->studentAddress,"Institution"->"Wolfram Summer School","CreationDate"->Now,"ProgramDateRange"->{DateObject[{2021,6,28}],DateObject[{2021,7,16}]},"Subject"->"Completion of Wolfram Summer School 2021","InstitutionPublicKey"->keys["PublicKey"],"InstitutionDigitalSignature"->GenerateDigitalSignature["WSS2021Certificate",keys["PrivateKey"]],"InstitutionDigitalSignatureMessage"->"WSS2021Certificate","InstitutionAddress"->BlockchainKeyEncode[keys["PublicKey"],"Address",BlockchainBase{"ARK","Devnet"}]|>]◼
MintNFT
mintNFT[metadata_,ownerAddress_,"ARK"]:=Module[{tx,txSigned,txSubmitted,metadataCID,keys=CloudGet[CloudObject[
https://www.wolframcloud.com/obj/christianp/NFTCertificateServer/keys/ARK
]]},metadataCID=ExternalStoragePut[metadata]["CID"];tx=BlockchainTransaction[<|"BlockchainBase"{"ARK","Devnet"},"Type""Transfer","Recipient"ownerAddress,"Amount"1,"Fee"->Quantity[0.03,"DARK"],"VendorField""ipfs://"<>metadataCID|>];txSigned=BlockchainTransactionSign[tx,keys["PrivateKey"]];txSubmitted=BlockchainTransactionSubmit[txSigned];txSubmitted["TransactionID"]]◼
APIFunction
CloudDeploy[APIFunction[{"Name"->"String","Address"->"String"},Module[{metadata,txid},metadata=createCertificateMetadata[#Name,#Address,"ARK"];txid=mintNFT[metadata,#Address,"ARK"];txid]&],"NFTCertificateServer/API/MintNFTCertificate",Permissions"Public"]
Client
Client
The Client, in this case the Student, would enter his “Full Name” and “Address” in the website that has been created using “CloudDeploy” function. The result would be a Transaction ID and that would mean that his/her NFT has been generated. We used “AppearanceRules” function to explain the process in the website.
CloudDeploy[FormPage[{{"Name","Full Name"}->"String","Address"->"String"},Module[{response},response=URLRead[HTTPRequest[URLBuild["https://www.wolframcloud.com/obj/christianp/NFTCertificateServer/API/MintNFTCertificate",{"Name"->#Name,"Address"->#Address}]]];"Your NFT certificate has been generated. TransactionID:<BR><BR>"<>response["Body"]]&,AppearanceRules<|"Title""Get your NFT certificate","Description""Please provide your full name and ARK devnet address. Click the Submit button to mint an NFT certificate. Please keep a copy of the transaction ID you will get.<BR><BR>If you don't have an ARK devnet address, please <a target=\"_blank\" href=\"https://www.wolframcloud.com/obj/joan.soler.vidal/SummerSchoolProject/AddressCreationProcess\">get one here</a>."|>],"SummerSchoolProject/NFTMinter"]
Out[]=
◼
Next image is a Screen capture of the browser of the process of getting an NFT completed:
Verifier (Third Party Organization)
Verifier (Third Party Organization)
We can check the data of the transaction using the TransactionID already generated and “BlockchainTransactionData” function.
◼
Student provides NFT transaction ID and address:
In[]:=
txID="e214b5cb5034b2081836fecc7508082a5b3f739daa7c98f6fc71413299229f39";studentAddress="DE1Jg7VJzsCtt5UTWjw3EeZpy1MwXzBxZc";
In[]:=
BlockchainTransactionData[txID]//Dataset
Out[]=
|
To get the data of the NFT, we need to extract it from the IPFS and we are going to use “ExternalStorageGet” function:
◼
Extract IPFS CID containing the NFT metadata:
In[]:=
nftCID=StringDrop[BlockchainTransactionData[txID,"VendorField"],7]
Out[]=
QmWRSSjQdsEFygkP65RHSv6nu34L6WqVENuvVqQT2hTjRx
◼
Download data from IPFS:
In[]:=
nftMetadata=ExternalStorageGet[nftCID];
◼
Here we can see the Metadata that contains our NFT:
In[]:=
nftMetadata//Dataset
Out[]=
|
In the case that a random institution wants to verify that the student is the real owner of the NFT, we are going to use the Pair of Keys of the Student previously created (stored in the Cloud) and the function “GenerateDigitalSignature” to proof it.
◼
Verifier asks student for a DigitalSignature. Student creates a digital signature:
In[]:=
myKeys=CloudGet["NFTCertificateKeys/studentKeys"]
Out[]=
PrivateKeyPrivateKey
,PublicKeyPublicKey
|
|
In[]:=
studentDigitalSignature=GenerateDigitalSignature["VerificationMessage",myKeys["PrivateKey"]]
Out[]=
DigitalSignature
|
◼
Verifier verifies the digital signature using the address's public key
In[]:=
studentPublicKey=myKeys["PublicKey"]
Out[]=
PublicKey
|
In[]:=
VerifyDigitalSignature[{"VerificationMessage",studentDigitalSignature},studentPublicKey]
Out[]=
True
Keywords
Keywords
Wolfram Language
Blockchain Technology
NFT
MintNFT
Blockchain Technology
NFT
MintNFT
Acknowledgments
Acknowledgments
I would like to thank my Mentor, Christian Pasquel for his mentorship that has done with me since the very first moment we met each other. Thanks to him, Wolfram Summer School has been an incredible experience for me. I would also like to thank the Organizing Committee and of course, Dr. Stephen Wolfram, for his valuable insights and advices that he gave me during the meetings we did during the Summer School.


Cite this as: Joan Soler-Vidal, "NFT Professional Credentials" from the Notebook Archive (2021), https://notebookarchive.org/2021-07-6gxysqt

Download

