Bacon Wallet is visually stunning, robust, and custom-designed Web3 management Hub tailored for the MultiversX ecosystem, allowing users to intuitively view, manage, and create NFTs and SFTs.
This phase focused on refining the UI/UX to a premium standard, connecting with IPFS for decentralized storage, and resolving outstanding edge cases.
- Architecture Secure-By-Design: Integrated Pinata via a secure Next.js backend API route (
/api/upload). ThePINATA_JWTsecret is never exposed to the client bundle, neutralizing the risk of key interception. - Automated Two-Step Minting Process: Implemented a friction-less flow in the
ToolsPagecomponent.- Image selected by the user is automatically uploaded to IPFS.
- A
metadata.jsonstandard file is generated encompassing all NFT information (attributes, name, royalties, etc.), and similarly uploaded to IPFS. - The final
metadataCidis linked to bothattributesandurisin the final MultiVersX blockchain transaction, making the NFT fully standard-compliant on explorers and marketplaces.
- Modal Image Fidelity (Aspect Ratios): Engineered an anti-cropping mechanism inside
pickOriginalImageUrl. The dApp now bypasses the compressed thumbnails served by the MultiversX gateways, fetching the purenft.url(the original image). TheNftMediacomponent now dynamically scales the image respecting its native aspect ratio (portrait, landscape, square) usingobject-containand padded bounding boxes without any distortion. - Dynamic Assets Loading: Added mapping for animated files (
.mp4,.gif) recognizingmimeTypeseamlessly alongside standard images. - Visual Fine-Tuning: Polished alignments and letter-spacing compensations across various badges and labels (e.g.
Asset Hub). - Theming & Global Splash: Generated standard Next.js
openGraphandtwitter-cardsmetadata utilizingbacon-iconimages. Updated the main splash page replacing CSS shapes with the official vector-styled logo, and successfully injected standard favicons. - Port Conflicts: Implemented graceful server restarting processes mitigating node conflict scenarios on standard 3000 ports.
- Long Press Refinement: Solved critical edge-cases during mobile long-press selection for multi-transfer operations (
send,list,burn). Established robust timeout state management insideTabSystem.tsxpreventing immediate deselection upon releasing the long press.
The application has been actively evaluated for safety vulnerabilities, taking into account both standard Web2 vulnerabilities and Web3 specific implementations. Here are the immediate actionable security recommendations ranging from dependency management to App-layer architecture:
- The Issue: An
npm auditreveals severe vulnerabilities tied to underlying dependencies. Specifically,Next.js < 15.5.9possesses Image Optimizer RemotePatterns vulnerabilities that can lead to Denial of Service (DoS). Also, theqspackage imported through@multiversx/sdk-web-wallet-iframe-providerpossesses high-risk DoS vectors due to array limit bypasses. Minimatch possesses regular expression DoS risks. - Remediation:
- Run
npm audit fixto automatically patch non-breaking minor versions (specifically minimizing theminimatchandnextDOS vulnerabilities). - Warning on forced upgrades:
npm audit fix --forcewould downgrade@multiversx/sdk-dappfromv5.6.2tov4.6.4which will break the entireuseGetAccountInfoecosystem syntax. DO NOT force downgrade. Instead, leveragenpm overridesornpm resolutionswithinpackage.jsonto safely force patch specificallyqsunderneath the MultiversX dependencies.
- Run
- The Issue: The
/api/uploadendpoint currently accepts any file from any origin, making it susceptible to Pinata upload abuse by malicious actors running bots. - Remediation:
- Rate Limiting: Implement Upstash or an in-memory rate limiter on the Next.js API route to cap the number of IPFS uploads per user.
- Authentication validation: Since the user must be logged in via Web3 to mint, pass a signed message or simple JWT to the
/api/uploadendpoint to verify the user holds a valid EGLD address before letting them upload to your Pinata cloud.
- The Issue: Image remote patterns in
next.config.mjsare broadly open (e.g. wildcard/**onmedia.elrond.com,ipfs.io, etc.). - Remediation:
- Restrict the
dangerouslyAllowSVGprotocol if you don't explicitly require rendering external SVGs. - The currently implemented inline CSP
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;"within image configs is a good start, but consider utilizing Next.js headers to implement a global restrictive CSP over the entire application.
- Restrict the
- The Issue: In
ToolsPage.tsx, transactions are constructed natively in the client and sent to the blockchain. - Remediation:
- Always validate the lengths of strings (like
assetForm.name,assetForm.collection) before broadcasting. MultiversX transactions can fail unexpectedly and burn gas if naming conventions breach byte limits or contain unmapped characters.
- Always validate the lengths of strings (like
- Verify that
.env.localcontainingPINATA_JWTis included in.gitignore(which typically is by default in Nextjs). Never push this to GitHub. Ensure production instances on Vercel/Netlify have these injected securely as Environment Variables.