1 of 14

256hax

0

2 of 14

Anatomy of Mad Mints

by 256hax

3 of 14

What is Mad Mints?

Improves the speed of minting transactions. With this approach, you'll be able to handle high demand and experience incredible UX. Armani found this approach and named "Mad Mints".

256hax

2

JST Jul 2 2023

4 of 14

Detailed Explanation by ChatGPT-3.5

3 STEPs to Implement Mad Mints.

256hax

3

JST May 24 2023

STEP1

Allocate Durable Nonces

STEP2

Buffer transactions into queue

STEP3

Async process

Allocate 10,000 durable nonces: Nonces are integer values used to differentiate transactions with the same key. By allocating 10,000 durable nonces, you ensure that transactions can be easily tracked and duplicates can be avoided. These nonces are stored in persistent memory and won't be deleted even during reboots or upgrades.

Docs: https://solanacookbook.com/references/offline-transactions.html

Use web2 infrastructure to buffer transactions into a queue: Employ web2 infrastructure, which refers to traditional web infrastructure, to buffer incoming transactions into a queue. Instead of sending transactions directly to the chain, you add them to the queue for processing. This helps handle sudden bursts of transactions and enhances scalability.

Asynchronously process the queue one by one: Process the transaction queue asynchronously, meaning you handle each transaction one by one. This allows you to manage the order in which transactions are processed. You won't move on to the next transaction until the current one has completed all its processing steps.

5 of 14

Process Overview

256hax

4

STEP1

Allocate Durable Nonces

STEP2

Buffer transactions into queue

STEP3

Async process

Queue

JST May 24 2023

Function

Data

Action

Create Durable Nonce

Async request

Sign Transaction

Sign

Add

Send Transaction

Nonce Account

Buffer Transaction

Buffer Transaction

Signature

6 of 14

Conclusion of Mad Mints

If you need fine-tuning speed, you should use Mad Mints.

256hax

5

Pros

(Value)

  • Mad Mints is 16 to 27 times faster than the standard.
  • The more NFTs you mint, faster it tends to become.
  • Easy to implement Mad Mints.

Example Case

  • It is useful when fine-tuning speed is required in milliseconds.�e.g. Minting Site, DEX and Fully On-chain site.
  • If speed is not a priority, standard transaction method is sufficient.

Cons

  • Create and store Durable Nonce Account in advance.
  • Total fees are higher, ranging 0.0014 - 0.02 SOL per transaction.�e.g. 10K mints are up to 200 SOL
  • (Option) You may need to build a queueing system for transactions.

JST Jun 12 2023

This conclusion is unofficial, in my opinion.

7 of 14

Mint NFTs - Speed Test Result (rough estimate)

256hax

6

Number of Mint NFTs *1

Mad Mints

Standard (Request directly)

Results

Average *2

Average

Transactions

1 NFT

50 ms

800 ms

Mad Mints 16 times faster

100 NFTs

1,900 ms

46,000 ms

Mad Mints 24 times faster

1,000 NFTs

17,000 ms

460,000 ms

Mad Mints 27 times faster

*1 Create Mint Account and Metadata Account Using Metaplex JavaScript SDK. It's not including upload Metadata JSON and image, verify collection.

*2 Use performance.now method of JS using Solana Test Validator v 1.15.2. macOS Monterey 12.6.5, MacBook Pro (13-inch, 2018), 2.7 GHz Core i7, Memory 16 GB

JST May 28 2023

Speed test scope of Mad Mints

8 of 14

Transfer SOL - Speed Test Result (rough estimate)

256hax

7

Number of Instructions per transaction *1

Mad Mints

Standard (Request directly)

Results

Average *2

Average

Transactions

1 Instruction

10 ms

20 ms

Mad Mints 2 times faster

10 Instructions

13 ms

29 ms

Mad Mints 2.2 times faster

40 Instructions

20 ms

53 ms

Mad Mints 2.6 times faster

JST May 28 2023

Speed test scope of Mad Mints

*1 Transfer SOL instructions using Solana web3.js.

*2 Use performance.now method of JS using Solana Test Validator v 1.15.2. macOS Monterey 12.6.5, MacBook Pro (13-inch, 2018), 2.7 GHz Core i7, Memory 16 GB

9 of 14

Transaction Processing Bottleneck

Speed bottleneck is "create and use Nonce" process in Sign Transaction.

256hax

8

Sign Transaction

(ToBe)

Mad Mints

(AsIs)

Standard

Create Nonce in advance

Create Instructions

Sign Transaction

Send Transaction

Create Instructions

Send Transaction

Speed Bottleneck

Use Nonce

Create Instructions

Create Durable Nonce

JST Jul 2 2023

Create and Use Nonce

10 of 14

Difference Between Mad Mints and Standard Transaction (Transfer SOL Instruction)

256hax

9

Mad Mints

Standard

Use Nonce ->

JST May 21 2023

11 of 14

Example Codes

256hax

10

https://github.com/256hax/mad-mints

Experimental purpose only.

JST May 21 2023

12 of 14

Directory Structure and Overview of Example Codes

256hax

11

mad-mints

+--- anchor

+--- docs

+--- packages

+--- queue

...

anchor

(example codes and validator)

packages

(private packages for utility)

queue

(queueing example codes)

common

script

(e.g. create durable nonce)

example code

(including speed test)

example code

(mint large amount NFTs)

queue system

(serverless queueing)

local validator

(clone Metaplex programs for NFT)

JST Jul 2 2023

call

call

request

request

request

13 of 14

Note

I made only Mad Mints example codes.

If you need to inquire "Mad Mints" brand, please contact Armani (@armaniferrante).

Mad Mints logo(fan art) was created by Designer @shiroperu.

256hax

12

JST Nov 22 2023

14 of 14