Yours Technical Logic
Last updated
Last updated
Yours provides Google and Kakao social login functionality, both of which operate using OAuth 2.0.
Users enter their account information in the Google or Kakao login window to perform the authentication process.
Yours Client receives an Access Token after the authorization code is issued and then forwards this token to the Yours Web Server.
Yours Web Server receives the User Resource with the Access Token, processes the registration, and issues its own JSON Web Token (JWT) to the Client.
Separate all typography within the Yours product into JSON.
Create a JSON file containing typography written in Korean.
Create a JSON file containing typography written in English.
Use the i18n (internationalization) library to parse the JSON and insert each typography in the correct location.
Use the useTranslation hook for language changes and language-specific styling.
Support for Ethereum-based wallets (Ethereum, Klaytn, Polygon, Aurora).
Support for Aptos-based wallets.
Generate a random mnemonic code.
Encrypt the generated mnemonic code using the user's passCode.
Ensure that decryption is only possible with the user's unique passCode.
Store the encrypted mnemonic code value in the database.
Supported on Ethereum.
Information about the Welcome NFT and pre-issued NFT addresses is stored in the database.
Click the 'Get NFT' button to receive the Welcome NFT.
Retrieve the stored Welcome NFT information from the database and communicate with the smart contract (Issuer and Owner is Yours).
In the smart contract, mint the NFT for the user and set the default benefits.
Then, assign a mintId to the user, defining it as minted in Yours.
Supported on Ethereum-based chains (Ethereum, Klaytn, Polygon, Aurora).
Supported using the ERC-721 standard.
Supported on Aptos chain.
Yours-defined NFT format on Aptos.
Ethereum-Based Chains
Retrieve NFT information from the database.
Upload NFT information to IPFS on the server side and communicate with the smart contract (Issuer and Owner is Yours) using the returned IPFS URL as an argument.
Deploy a proxy contract that references the YoursBenefitNFT
contract and execute the initialize function.
Aptos Chain
Retrieve NFT information from the database.
Execute the deployAptosNFT
function with arguments including nft name, nft metadata uploaded to IPFS (nft name, description, image link), and benefit link.
Deploy 100 tokens (developer-defined, modifiable) and mutate_property
one token among the 100.
Then, modify the owner attribute to version1.
Supported on Ethereum-based chains (Ethereum, Klaytn, Polygon, Aurora).
Supported using the ERC-721 standard.
Supported on Aptos chain.
Yours-defined NFT format on Aptos.
Ethereum-Based Chains
Retrieve NFT information from the database.
Upload NFT information to IPFS on the server side and communicate with the smart contract (Issuer and Owner is Yours) using the returned IPFS URL as an argument.
In the smart contract, mint the NFT for the user while setting the default benefit.
Then, assign a mintId
to the user to define the minting process in Yours.
Aptos Chain
Retrieve NFT information from the database.
Among tokens with property_version
0, modify the owner using the mutate_property
function and store in index_list the numbers of benefits the user has.
Increments the maxPropertyVersion
of tokens with property_version
1 by +1.
Upload a photo and request verification.
NFT creator can accept or reject the verification request in the admin page.
Randomly generate an email verification code.
Store the email as the key and the verification code as the value in Redis.
Use the NodeMailer library to send an email.
When the user clicks the verification button in the email sent, redirect them to the Yours page.
The page URL for redirection contains an encrypted verification code.
Parse the verification code from the URL and validate it.
These features enable Yours to perform identity verification through online or offline data.
Supported on Ethereum-based chains (Ethereum, Klaytn, Polygon, Aurora).
Supported using the ERC-721 standard.
Supported on Aptos chain.
Yours-defined NFT format on Aptos.
Ethereum-Based Chains
Retrieve the NFT information with modified benefits from the database.
On the server-side, upload the NFT benefit information to IPFS and use the returned IPFS URL as an argument for smart contract communication (Issuer and Owner is Yours).
Execute the setBenefitsURI
function in the smart contract to change the benefitURI.
Aptos Chain
Retrieve the NFT information with modified benefits from the database.
On the server-side, upload the NFT benefit information to IPFS and use the returned IPFS URL as an argument for smart contract communication (Issuer and Owner is Yours).
Execute the mutateProperties
function to add the IPFS URL to the value field.
Ethereum-Based Chains
Retrieve the mintId
granted to the user from the database.
Communicate with the smart contract by providing the external EVM wallet address and mintId
received in the request as arguments.
Execute the transferFrom
function within the smart contract.
Aptos Chain
Retrieve the NFT Name
and id
assigned to the user from the database.
Using the external Aptos wallet address received in the request, NFT Name+ID
value, and mintId
configure an SDK caller.
Execute the offerToken
function of the Aptos SDK and send it to the target Wallet Address.
Supported on Ethereum-based chains (Ethereum)
Supported using the ERC-721 standard.
For Klaytn, Polygon, and Aurora, only need to make changes to the RPC (Remote Procedure Call) configuration and deploy the contract.
Supported on Aptos chain.
Ethereum-Based Chains
Using the array of requested nftIds, retrieve information from the database for two or more nftAddresses and mintIds.
Communicate with the smart contract by providing nftAddress
array and mintId
array as arguments.
Lock
the benefit NFTs in the smart contract, put nftAddress
and mintId
values into the nftInfo
interface, and create a integrated NFT.
Map the created integrated NFT information and user ID to store in the database.
Aptos Chain
Retrieve user names and information for nftNames from the database using the array of requested nftIds.
Communicate with the contract by providing owner, uri, nftNameList, and propertyVersionList as arguments.
Create a Integrated NFT.
Note (Aptos)
In the context of Ethereum Virtual Machine (EVM), we have configured the locking mechanism to make it impossible to transfer or burn NFTs.
However, it is not possible to implement locking using the Aptos SDK. As a result, we have implemented a solution where we bundle NFT information and issue a new NFT, recording the details of the locking process in the database.
It's worth noting that the NFTs used in the integrated NFT are minted to the Yours central wallet during the minting phase, and ownership remains with Yours. Therefore, users cannot transfer or burn these NFTs on their own.
When the integrated NFT is burned, users regain control over their original NFTs.
Ethereum-Based Chains
Retrieve nftAddress and mintId information from the database using the array of requested nftIds.
Communicate with the smart contract by providing nftAddress
array and mintId
array as arguments.
Lock the additional benefit NFTs in the smart contract, adds nftAddress
and mintId
values to the nftInfo interface, and modifies the integrated NFT.
Update the database by mapping the additional benefit NFT IDs to the user's ID for the integrated NFT.
Aptos Chain
Under development
Ethereum-Based Chains
Communicate with the smart contract by providing the contractId
and the Yours central wallet address as arguments.
Unlock the additional benefit NFTs and burns the integrated NFT.
Aptos Chain
Under development
As of 2023.10.06, the NFT marketplace supports only Yours wallet interworking.
View user information through social login.
Check your information to link your wallet with your NFT marketplace through wallet information given to you by Yours.
If you are not a member of Yours, proceed with the membership registration.
Based on 2023.10.06, token types support ERC-721 only.
When you're trying to sell an NFT to an NFT marketplace linked to Yours, check the NFT address you're trying to sell.
If you are an NFT that is not listed on the NFT marketplace, communicate with the Marketplace Smart Contract to set up ownership changes to allow you to sell your NFTs.
Register NFT sales information through Marketplace Smart Contract with NFT id and NFT address, token type, and price information.
Token types based on 23.10.06 only support ERC-721.
When you're trying to purchase an NFT on an NFT marketplace linked to Yours, check the NFT address you want to purchase.
Register NFT purchase information by communicating with Marketplace Smart Contract with NFT Id and NFT address, token type, and owner information.
The user can select a stablecoin to use for charging before charging the YRP point. (Currently, only USDC is supported, and other stablecoins will be added later)
Yours internal logic calculates the maximum chargeable amount and allows the user to enter the desired charge quantity within the limit. As of October 06, 2023, the exchange rate between stablecoins and YRP points is 1, which can be charged from a minimum of 10YRP to a maximum of 10,000,000YRP.
Subsequently, the transaction cost is calculated, and the user must own more than the total transaction amount, including the transaction cost, to proceed with the transaction.
Executes a transaction that transfers stablecoins to Yours Pool.
Information such as transactions generated from transactions and network fees are provided to the user.
Wallet connection information is managed through react-redux
and local-storage
. Users who connect their wallets once will not be automatically disabled unless they directly release them or Metamask
authentication fails.
After a connection, the address
and signer
objects are managed through the global state.
Redux
and local-storage
separate the chain of wallets that you are currently connected to.
After connecting, manage information about the user's wallet
through the wallet object.
Use the Moralis SDK
to obtain NFT information that you own in your external wallet.
Deliver pre-processed data NFT information to Yours that you own in your external wallet.
Yours distinguishes external NFTs by two criteria.
a. NFTs Published by Yours protocol and Transferred Outside
b. NFTs Not Published by Yours Protocol
In the case of 3-a, the user who transferred the NFT to Yours will be given full rights again.
For 3-b, yours manages the original NFT and issues wrapping NFTs to users, giving them full rights to NFTs of equal value.
a. Deposit the original NFT to the Contract.
b. Once the deposited results have been confirmed, mint NFTs (wrapNFTs) with the equivalent value of NFTs delivered through wrapping and issue them to the user. Users will then be able to experience all the benefits offered by Yours even with NFTs not created by Yours protocol.
c. If you move that NFT back to your external wallet, burn the wrapNFT and transfer the original NFT that was managed by the contract to your wallet address.
Preparing
For EVM-based chains, it is designed to be cost-effective and modifiable by using the
Since Aptos does not have mintId
, it defines minting in Yours by assigning property_version
to the user. Concepts related to this can be found on the .
Use library.