Closed Greg4389 closed 2 years ago
I had this issue this morning. It may be linked to Pinata as I was unable to access my json folder from the browser and when I tried to open my Jpeg to view, Pinata told me I had tried to view this image too many times (I tried only one mint and one view) and that I should upgrade.
@jamaya23 and @Greg4389 Do you still experience this issue?
If so, I think we need you to open a new ticket with support. We are seeing a few more of these reports in Discord.
The link to post a new support ticket is here: https://loopring.io/#/newticket
Before you create a new ticket, please follow these steps to get the proper error and request information from your browser so the team can better support you. The following process is for Firefox but should be the same for most major browsers.
Please let me know if you have troubles.
I just got another report from a user in discord that had this error. I sent them to support because they were getting a specific error in the dev tools of their browser.
However, this person says they fixed their minting issue by doing something with the metadata json file. I have not received a response what the fix was, but it seems like they started over from the beginning and following the zoho article to mint.
Maybe this will work for you guys as well @jamaya23 @Greg4389 ? https://desk.zoho.com/portal/loopring/en/kb/articles/nft-minting-on-l2
I just worked with another user that had this issue. Occurred every time they tried to mint this one particular metadata file. They had previously minted 37 NFTs in the exact same way, and I confirmed there was nothing wrong with their IPFS files, syntactically or being able to load.
@fudgebucket27 Ran into an issue with his API minter where this same ecdsa signature problem would appear only with certain CIDs. So I had the user rename his metadata file and upload to Pinata again to get a new CID. The issue was gone! So far three people have confirmed this fixed the issue for them.
Fudgey was able to sort out the issue on his end, I will let him add details of that fix.
You will need to add a space to the end of the file contents top change the CID.
I believe the fix for this needs to be made in the SDK. The method 'ipfsCid0ToNftID' is where the problem arises, some CIDs do not convert to an NFT ID correctly because no encoding has been specified
Line 288 in nft_api.ts needs to be changed to include the encoding
const hashHex = Buffer.from(cid.multihash.slice(2)).toString("hex");
Please look at the documentation for the cids library you are using at https://github.com/multiformats/js-cid
I believe something along the lines of the following needs to be done
const multihashing = require('multihashing-async')
const bytes = new TextEncoder('utf8').encode(cidV0Str)
const hash = await multihashing(bytes, 'sha2-256')
EDIT: THIS IS WRONG. SEE MY LATEST COMMENT
Update for this. It appears this actually has to do with some CIDs missing leading zeroes in the converted hash. Here is a problem CID: QmNuqdeWUJ9iEiw5qZfJ2pJ9onqAS45ZffvV8JQSUzp7DQ
var CID = require("cids");
var BN = require("bn.js");
var cid = new CID("QmNuqdeWUJ9iEiw5qZfJ2pJ9onqAS45ZffvV8JQSUzp7DQ");
var hashHex = Buffer.from(cid.multihash.slice(2)).toString("hex");
var hashBN = new BN(hashHex, 16);
console.log("0x" + hashBN.toString("hex"));
The conversion returns 0x880847b7587968f32ba6c741f9d797d9dc64971979922a80c4e590453b8dc2f when it should really be 0x0880847b7587968f32ba6c741f9d797d9dc64971979922a80c4e590453b8dc2f
The missing 0 causes an issue with the nftHi and nftLo calculations here https://github.com/Loopring/loopring_sdk/blob/2f0d3ad66a0facbdef1ecb190d6f98861abb58bf/src/api/sign/sign_tools.ts#L754-L755 due to the shortened length of the string.
You may want to make the start of the generated nft id 0x0 if it doesn't equal 66 characters to fix this or just do this
"0x" + hashBN.toString("hex").padStart(64, "0")
EDIT: Heres another problem CID: QmPAEkadaB6eiBwbZY4EM7zomc6ENLC1U2WVumDQvaHwtn. This converts to 0xc30ca49378bddda511b7841e9697ae26a58544044c37bca614cbec6f9d1a6c3 when it should really be 0x0c30ca49378bddda511b7841e9697ae26a58544044c37bca614cbec6f9d1a6c3
Please see below for description of my current setup:
NFT Image populates in thumbnail prior to mint, so I assume that .json file was made correctly .json and image saved to pinata cloud Plenty of loops in my l2 account. Signature through MetaMask - I do not have any coins in metamask On Brave browser - shields down on loopring site