Notice: 2025-06-14

Development progress is summarized here.

https://zenn.dev/nakamura196/books/41693d2d017082

Overview

Starting with the following article, I have been prototyping a digital cultural heritage management system using blockchain.

This time, I modified the system so that uploaded data is recognized as NFTs.

This is a learning process, so there may be incomplete aspects, but I hope it serves as a helpful reference.

Usage Page

The file upload method remains the same as before. A link to the detail page was added to the list page displayed after upload.

Clicking the link navigates to the following detail screen.

Implementation

This section was written by AI.

1. Making the Contract NFT-Compatible

The existing digital cultural heritage management contract was modified to comply with the ERC721 standard as an NFT contract.

Main Changes:

1. Adding OpenZeppelin Libraries

iimmppoorrtt""@@ooppeennzzeeppppeelliinn//ccoonnttrraaccttss--uuppggrraaddeeaabbllee//ttookkeenn//EERRCC772211//EeRxCt7e2n1sUipognrsa/dEeRaCb7l2e1.UsRoIlS"t;orageUpgradeable.sol";

2. Changing the Contract Inheritance Structure

c{}ontrIOUEEanwURRcinPCCttaS77ibU22Dalp11ilegUUgiUrpRizpagItagdrSabreatllaadoHedbere,elaaraebgib,letleUae,pg,geraidseable

3. Updating the Initialization Function

f}uncti____oOUEEnwURRnPCCiaS77nbU22ilp11teg_Ui_riRaianIlndiSiiettzta(oe(b"r(mlDa)seigg_gep.ii_usntibeianlntliid(tce)H(r;e)i)r;n;iittaigael"i,ze"rDH{");

4. NFT Minting on Cultural Heritage Registration

f)}unpcutssssbuh}__eittttlie)ssmorrrrinr)aeiniiiictSi;Mfttnnnn2atindiotiieTrgggg{5vadaemwisnMoHe6eg:msanmDtikegmmmmeecgeeenerieeeeicsi:rerslatnismmmmdu.diU:tes(Uttoooolp,_pratmRaerrrr=tuntlmmeNsIgryyyyusai:spdFg(eHhrhmog::T.iRe____ea(en_.sdernditrlH,:isbfe,giaemoiemelanitmsakthr_anold_saecgeaeidgdcsettg,rengrteeekeroeeiUUeiasUr.,kr(prRstgcr,teetlI.aerliindi,lg(i,mdU(oee{pe)Rinnts;Id,gdit),taoa;htnmm;a,ps,g.sender,_name);

2. Implementing the Metadata Management System

To support the standard NFT metadata format, server-side metadata generation and upload functionality was implemented.

1. Metadata Generation in API Route

c}o;nc}c}sso;o)rtnndia]nt;csaemtCsyU/utmsat{}{}otppapecgr,nelplm:reitvtvvj:opei:braraesaatnpualalro'dadaatitiuiutnapMdmimeteteBptieaeoas_:_:Jlpo/tt,ng:ttSoluaa:eyny"ObiIpdU[pepDNcPla=drewei=aFotel::gttSaa{s,DionidTc"a"teou/orRtCaBwnsrPieeall/ioipg(toBjnunti)eCblsgtais.guooetottolabnP.anrortn('ij,aIyud[ns=tS"rJaiO,auStaoSlpOasntlNyrHo.AnDieasPcanrdtItgir(e(ttin")aona,ggmePie"if,nya(dtmeaestcardiapttai,onn,ulilm,ag2e)U]r,l){=>{

2. Frontend Integration

c}o;nccmmmmc}ca)Fsooeeeeo)ow;ltnnttttnmb;naffimo1s2saaaaseos3ioomewh.t.tddddttdt.trrat:aaaaahymmganUiGmttttmo:mRrDDedIdpmeeaaaaedeeeaaUamllantFFFFt:mtggttrtaeogeaooooaeaiiaalagSaerdrrrrd'tdss..,ReudUaammmmaPaattndebrttDDDDtOdteeaesumileaaaaaaSaarrmsupimFttttRTtRHecllta=aoaaaae'aewe,rtognr....s,Fsiri.a=efdmaaaapoutipudoDpppporlhttratruappppnmtailsompteeeesDtgoyDlannnnea=hennIaoddddte(,McPta=((((=aaeFad''''wct(S.ntndiaaoaeimeyaemwind)mewpmsaattaateecgirt=gaF''retmaa>edo,,iUecUarprfttg{rtm'ftleaelaDmoi'td(n;aero,caieottmnhtnrnaaD'i(aca(da,m'Rltt)ata/euih;tafgasdoea.oeppin'nrUions)amr/nge;mDlusrea)petv)t;l.oCe;aojkor.asenddontse'nris,(Uadc)Rcer{;Iti)prteigoins)t;ration

Summary

I hope this serves as a helpful reference in the process of learning Web3 and NFTs.