Building Multi Beasts with the Haas Brothers

An NFT drop where your answers to a personality test decide what your creature looks like. How we built the quiz, the contract, the trait engine and the mint-day plumbing.

Colourful abstract blob creatures with mismatched eyes on a dark grid

Most NFT collections work the same way. Somebody draws a few hundred layers, a script stacks them into thousands of combinations, a contract hands them out at random, and rarity is a spreadsheet. You pay, you get whatever the dice gave you.

Multi Beasts, by the artists The Haas Brothers, was built on a different idea. The collection was announced as 8,888 "unique digital portraits", and you didn't just mint one. You took a personality test first. The questions were drawn as abstract art rather than written as a multiple-choice form, and your answers shaped the traits of the beast you got. Press at the time called it personality-defined rarity. It was their first project in web3, it ran on Ethereum, and it trades on the usual secondary marketplaces.

My team at Dizart built it. This is how, with the caveat that some details here are simplified and a few are reconstructed from how we would normally do it rather than from notes I still have.

The shape of the problem

Strip away the art and the requirements were short:

  1. A quiz that feels like part of the artwork, not a form bolted onto a mint page.
  2. A guarantee that the answers you gave are the answers that shaped your beast. No editing the result after the fact, by us or by you.
  3. A mint that survives the first hour, when everyone arrives at once.
  4. A reveal that turns answers into a finished image and a metadata file that marketplaces can read.
  5. A gallery where you can find your beast and see why it looks the way it does.

The tension is between points 2 and 4. Generating images on-chain is expensive and limits the art. Generating them off-chain means trusting a server. The way through is to keep the expensive thinking off-chain and put only a commitment on-chain: a hash of the answers, signed by us, that the contract checks before it lets you mint.

The system on one pageThe chain only checks a signature and counts. Everything expensive happens off-chain, behind a commitment the chain can verify.

The quiz is the front door

The artists wanted the questions to be pictures. That ruled out anything that looked like a survey tool, and it meant the quiz was the heaviest part of the site: large textures, animation, and a lot of people on phones.

What worked for us:

  • Ship it as static files. The quiz is a client-side app on a CDN. No server renders a page on mint day. The only dynamic call is the one that submits answers.
  • Load the next question while you look at the current one. Each question's art is fetched one step ahead. The first question is tiny so the page is interactive almost immediately; the heavy textures stream in behind it.
  • Degrade, don't break. On phones without good WebGL support we fell back to pre-rendered video loops of the same art. Same question, cheaper pixels. Nobody should fail to mint because their GPU is old.
  • No wallet until the end. Connecting a wallet is the scariest step for new collectors, so we asked for it after the quiz, not before. You've already invested five minutes and you know what you're minting.

The last point mattered more than anything technical. Asking for a signature on the first screen made people leave. Asking at the end, when they wanted their beast, didn't.

Answers, hashed and signed

When you finish, the browser sends your answers and your wallet address to the answers API. The API checks the answers are well formed, rate limits by wallet and IP, stores them, and returns a voucher: a small EIP-712 signature from a key only our signer holds, saying this wallet may mint in this phase with this answers hash.

The contract doesn't need to know anything about personalities. It checks three things: the signature is ours, the voucher is for the wallet sending the transaction, and that wallet hasn't hit its cap. Then it mints and records the answers hash against the token.

contracts/MultiBeasts.sol
solidity
// simplified: real contract had pausing, withdraw, royalties and more checks
contract MultiBeasts is ERC721, EIP712, Ownable {
    uint256 public constant MAX_SUPPLY = 8888;
    uint256 public constant PER_WALLET = 2;
    address public signer;
    uint8 public phase; // 0 closed, 1 allowlist, 2 public
    uint256 public totalMinted;
 
    mapping(address => uint8) public minted;
    mapping(uint256 => bytes32) public answersOf;
 
    bytes32 private constant VOUCHER =
        keccak256("Voucher(address wallet,bytes32 answers,uint8 phase)");
 
    function mint(bytes32 answers, bytes calldata sig) external payable {
        require(phase != 0 && totalMinted < MAX_SUPPLY, "closed");
        require(minted[msg.sender] < PER_WALLET, "cap");
        bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(VOUCHER, msg.sender, answers, phase)));
        require(ECDSA.recover(digest, sig) == signer, "bad voucher");
 
        uint256 id = ++totalMinted;
        minted[msg.sender] += 1;
        answersOf[id] = answers;
        _mint(msg.sender, id);
    }
}

A few choices in there are worth defending:

  • A signed voucher instead of a Merkle allowlist. Merkle proofs are the usual way to run an allowlist, and we used the same signer for that phase too. The difference is that the voucher can carry data the contract should commit to, in our case the answers hash. One mechanism, two jobs.
  • The hash goes on-chain, the answers don't. Storing a 32-byte hash per token is cheap. Storing the answers themselves would cost more gas and publish them for everyone. With the hash on-chain, anyone holding the answers can prove they match.
  • Plain ERC-721, sequential ids. We looked at gas-optimised batch-mint variants. With a cap of two per wallet the saving was small, and a boring contract is one fewer thing to audit at 2am.

From a personality to a beast

The trait engine is where the art lives. It takes the answers, turns them into scores on a handful of personality axes, then rolls each trait with odds tilted by those scores. The roll is seeded by the token id, the answers hash, and a reveal seed we committed to before the mint and published after it. So the result is deterministic: render the same token twice and you get the same beast, and nobody, including us, could have steered which token got which traits after the fact.

From answers to layersThe quiz tilts the odds; it never picks the trait outright. Two people with similar answers still get different beasts.

traits/roll.ts
ts
type Axes = Record<"bold" | "calm" | "social" | "curious" | "odd", number>; // each 0..1
 
export function rollTrait(
  table: { name: string; weight: number; leans?: Partial<Axes> }[],
  axes: Axes,
  rand: () => number, // seeded from tokenId + answersHash + revealSeed
) {
  // base rarity weight, nudged by how well the option fits this personality
  const tilted = table.map((o) => {
    const fit = Object.entries(o.leans ?? {}).reduce((s, [k, v]) => s + axes[k as keyof Axes] * v!, 0);
    return { ...o, w: o.weight * (1 + fit) };
  });
  const total = tilted.reduce((s, o) => s + o.w, 0);
  let x = rand() * total;
  return tilted.find((o) => (x -= o.w) < 0)!.name;
}

Two things I'd point out. First, the tilt multiplies the base weight rather than replacing it, so the rarity table stays roughly true across the whole collection whatever the answers look like. We ran the engine over large batches of synthetic answers before launch to check that no trait went from rare to common because one answer was popular. Second, the seed includes something we committed to in advance. Without it, someone who knew the algorithm could game the quiz for a rare trait.

The renderer then stacks the chosen layers into a PNG, writes the metadata JSON with the traits as attributes, and pins both to IPFS. The contract's token URI points at the metadata. Before reveal it pointed at a placeholder that every token shared.

OptionWhy you'd pick itWhy we didn't make it the only copy
IPFS, pinned by us and one pinning servicecontent addressed, what marketplaces expectpins can lapse if nobody pays
Arweavepay once, stored for a long timeslower to iterate during reveal week
Our CDNfast, cheap, easy to purgenot decentralised; a mirror, not the source
On-chain SVGlives as long as the chainlimits the art; expensive

We went with IPFS as the source of truth, a second pinning provider so one billing mistake couldn't lose the collection, and a CDN in front for the gallery and our own pages.

Mint day

Mint day is a load test you only get to run once. Page views spike the moment the link goes out. Mints spike when phases open. And the shared bottleneck isn't your servers, it's the RPC node your users' wallets and your site talk to.

Mint day, hour by hourIllustrative shapes. The quiz smooths the spike: you can't mint until you finish it, so mints trail views by minutes.

What we did about it:

  1. Nothing dynamic on the hot path except the answers API. The site, the quiz and the art were static on a CDN. The answers API was small, horizontally scaled, and had nothing to do except validate, write a row and sign.
  2. Rate limits by wallet and by IP, with a bot check on submit. The cap of two per wallet is enforced by the contract; the rate limit is there so bots can't hammer the signer.
  3. Two RPC providers, failover in the client. When the primary started throttling, reads switched to the secondary without the user noticing. Writes always go through the user's own wallet, so the main job was keeping our reads, and the "did my mint land?" checks, alive.
  4. A pause switch and people watching it. The contract could be paused by a multisig. We never used it, but we rehearsed it.
lib/rpc.ts
ts
const providers = [process.env.NEXT_PUBLIC_RPC_A!, process.env.NEXT_PUBLIC_RPC_B!];
 
export async function rpc<T>(method: string, params: unknown[]): Promise<T> {
  let lastError: unknown;
  for (const url of providers) {
    try {
      const res = await fetch(url, {
        method: "POST",
        headers: { "content-type": "application/json" },
        body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
        signal: AbortSignal.timeout(4000),
      });
      if (res.status === 429 || res.status >= 500) throw new Error(`rpc ${res.status}`);
      const body = await res.json();
      if (body.error) throw new Error(body.error.message);
      return body.result as T;
    } catch (e) {
      lastError = e; // try the next provider
    }
  }
  throw lastError;
}

The quiz turned out to be a gift for load. Because you couldn't mint without finishing it, mints arrived spread over minutes instead of all in the first few seconds. A plain mint button would have made the spike much sharper.

The gallery reads from a database, not the chain

Asking the chain "what does this wallet own?" is slow and awkward. So a small indexer followed the contract's Transfer events, wrote them into Postgres, and the gallery read from there. Reorgs are the classic trap: an event you indexed can disappear if the block it was in gets replaced. We handled that the simple way, by only treating events as final after a number of confirmations and re-scanning a short window of recent blocks on every pass.

indexer/schema.sql
sql
create table tokens (
  token_id     integer primary key,
  owner        bytea   not null,
  answers_hash bytea   not null,
  traits       jsonb,                 -- filled in at reveal
  minted_block bigint  not null,
  updated_at   timestamptz not null default now()
);
 
create table transfers (
  tx_hash   bytea   not null,
  log_index integer not null,
  block     bigint  not null,
  token_id  integer not null references tokens,
  "from"    bytea   not null,
  "to"      bytea   not null,
  primary key (tx_hash, log_index)    -- replaying a block is a no-op
);
create index on tokens (owner);

The primary key on transfers is the important line. Re-scanning blocks means seeing the same event more than once, and the database refuses the duplicate for us.

What went wrong

Not everything was smooth.

  • The art was heavier than anyone budgeted for. The first version of the quiz was beautiful on a laptop and painful on a mid-range phone. We cut texture sizes, pre-rendered the hardest scenes to video, and set a weight budget per question that design and engineering both signed.
  • Wallet edge cases ate days. Mobile wallets with in-app browsers, users on the wrong network, people who signed and then closed the tab. Each needed a clear message instead of a spinner.
  • Support questions came in about the quiz, not the chain. "Why did I get this trait?" was the most common one. We should have shipped the explanation in the gallery from day one instead of adding it after.

What I'd do differently

I'd make the gallery explain each beast: which answers pushed which traits, shown next to the art. That was the whole point of the project, and we left it as a follow-up.

I'd publish the trait engine and the reveal seed process in the open before mint, not just after. Determinism only builds trust if people can check it.

And I'd budget more time for the quiz and less for the contract. The contract was a hundred-odd lines we could review carefully. The quiz was where the artists' idea either worked or didn't, and it deserved the extra week.

Working with artists was the best part. Engineers tend to ask what the minimum is. The Haas Brothers kept asking what it should feel like, and the project was better for it.