<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matthew Wilber</title>
    <description>The latest articles on DEV Community by Matthew Wilber (@greenzeta).</description>
    <link>https://dev.to/greenzeta</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F274719%2F2b36ccdd-65b9-4d5f-97d9-615ce9e3f48c.png</url>
      <title>DEV Community: Matthew Wilber</title>
      <link>https://dev.to/greenzeta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/greenzeta"/>
    <language>en</language>
    <item>
      <title>Zeta Comics: Blending AI &amp; Art in Digital Stories</title>
      <dc:creator>Matthew Wilber</dc:creator>
      <pubDate>Tue, 08 Oct 2024 00:41:25 +0000</pubDate>
      <link>https://dev.to/greenzeta/zeta-comics-blending-ai-art-in-digital-stories-1jme</link>
      <guid>https://dev.to/greenzeta/zeta-comics-blending-ai-art-in-digital-stories-1jme</guid>
      <description>&lt;p&gt;In the ever-evolving landscape of digital art, the intersection of creativity and technology is opening up avenues I never before thought possible. Enter the &lt;a href="https://comicgenerator.greenzeta.com/" rel="noopener noreferrer"&gt;Zeta Comic Generator&lt;/a&gt;, a project that marries human drawn cartoons with the growing capabilities of artificial intelligence. The project is not just an art and tech demo. It’s also a personal journey that weaves together a love for drawing, programming, and a curiosity for the potential of AI. This article delves into the origin of the &lt;a href="https://comicgenerator.greenzeta.com/" rel="noopener noreferrer"&gt;Zeta Comic Generator&lt;/a&gt; exploring its conception, the software mechanics behind it, and the techniques that drive its fusion of hand-drawn art and AI-generated content.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;The Idea&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;My engagement with cartooning can best be described as sporadic. Central to my experimentation as an artist is &lt;a href="https://greenzeta.com/project/illustrations/" rel="noopener noreferrer"&gt;Alpha Zeta&lt;/a&gt;, a green alien who is a recurrent figure in my ventures. Conceived during my high school years, Alpha Zeta became a distinctive presence in my work as a software engineer. I always wanted to create an episodic series featuring a group of aliens, but always lacked a coherent narrative. I dabbled in it many times but never found a good story to pursue.&lt;/p&gt;

&lt;p&gt;When I began &lt;a href="https://www.youtube.com/watch?v=MR2CvWxOEsw" rel="noopener noreferrer"&gt;doing talks for a local developer group&lt;/a&gt;, I started adding &lt;a href="https://slides.com/greenzeta" rel="noopener noreferrer"&gt;Alpha Zeta to my slides&lt;/a&gt;. It served as a visual embellishment, something to jazz up my presentation. I continued the practice in my &lt;a href="https://greenzeta.com/articles/" rel="noopener noreferrer"&gt;articles&lt;/a&gt; and &lt;a href="https://greenzeta.com/originals/" rel="noopener noreferrer"&gt;projects&lt;/a&gt;. It was fun drawing these one-off character poses with no context, so I kept doing it. Soon I had a &lt;a href="https://greenzeta.com/project/illustrations/" rel="noopener noreferrer"&gt;small library of my own character art&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jgxw28crdw8jvjjrk90.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jgxw28crdw8jvjjrk90.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The advent of AI in art, particularly through &lt;a href="https://openai.com/product" rel="noopener noreferrer"&gt;GPT and Dall-E&lt;/a&gt;, marked a turning point. Initially, my gateway drug into AI was &lt;a href="https://openai.com/dall-e-2" rel="noopener noreferrer"&gt;Dall-E 2&lt;/a&gt; and &lt;a href="https://www.midjourney.com/home" rel="noopener noreferrer"&gt;Midjourney&lt;/a&gt;. Though Midjourney produced better results, I gravitated to Dall-E because it had a free tier. It led me to create background images that I could place my character poses on, like an animation cell. Dall-E 3 offered a huge upgrade in output quality. With &lt;a href="https://chat.openai.com/" rel="noopener noreferrer"&gt;ChatGPT&lt;/a&gt; integration, now I have the ability to create reference images on demand. I was sold on the subscription price.&lt;/p&gt;

&lt;p&gt;Going back to the desire for an episodic series, I thought it would be great if an AI could just write one for me. It was a pipe dream. I had no illusions of what GPT is capable of. Thoughts like that, I think, are at the root of most people’s disappointment with AI. But I thought it might be just good enough for a really short story. GPT can output JSON, so hooking it into a JavaScript app is trivial. After some experimentation in ChatGPT, I was confident the concept would work.&lt;/p&gt;
&lt;h1&gt;
  
  
  &lt;strong&gt;The Technique&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;The &lt;a href="https://comicgenerator.greenzeta.com/" rel="noopener noreferrer"&gt;Zeta Comic Generator&lt;/a&gt; manages a series of sequential calls to both GPT and Dall-E. The models work together in scriptwriting, background generation, and the integration of hand-drawn character art.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;AI Script&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Each comic strip begins with a premise, a seed for a story told through AI’s “imagination”. Everyone visiting the Comic Generator can enter their own premise on the site’s “&lt;a href="https://comicgenerator.greenzeta.com/generate" rel="noopener noreferrer"&gt;Create&lt;/a&gt;” page. That premise is then inserted into a prompt for the AI. GPT, playing the role of a cartoonist and humorist, uses the premise to weave a narrative for a three-panel comic strip featuring Alpha Zeta. The script, output as a JSON object, outlines the scene and dialogue for each panel. The stage is set for the visual elements to come alive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61rsujpozm01pf98ck7m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61rsujpozm01pf98ck7m.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;AI Background&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With the script as the foundation, GPT’s next role is to conjure the visual settings for each panel. It crafts prompts for Dall-E, meticulously describing each backdrop while ensuring the focal point, Alpha Zeta, remains absent, reserved for the final touch of hand-drawn art. These prompts are sent off to Dall-E to generate background images for each panel of the comic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow0h4si7huhvtprzwctj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow0h4si7huhvtprzwctj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Hand-Drawn Character&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The comic generator offers a &lt;a href="https://comicgenerator.greenzeta.com/about#character-art" rel="noopener noreferrer"&gt;growing number of Alpha Zeta actions&lt;/a&gt;. Each one a hand drawn image, bringing consistency and emotion to the comic. Each action is represented as a word, e.g. standing, sitting, joyous, terrified. The script is sent back to GPT where it is asked to choose which of the action words best describes what the character is doing in each panel. Its choice determines the image that appears in the panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzs4z6o290tnwm7j8qggu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzs4z6o290tnwm7j8qggu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  &lt;strong&gt;The Process&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;The Comic Generator has a PHP back-end and JavaScript front-end. The back-end handles all communication with the OpenAI API, the front-end manages the sequential calls, responses, and ultimately composes the final result. For those interested in the inner workings of this project, the complete source code is available on GitHub.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mwilber" rel="noopener noreferrer"&gt;
        mwilber
      &lt;/a&gt; / &lt;a href="https://github.com/mwilber/zeta-comic-generator" rel="noopener noreferrer"&gt;
        zeta-comic-generator
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      An experiment in AI and art to create dynamic comic strips.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Zeta Comic Generator&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;An experiment in AI and art to create dynamic comic strips.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://comicgenerator.greenzeta.com/detail/8e6b42f1644ecb1327dc03ab345e618b" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/1252a36838cff6248fb0737bf8ecc06bdbca9db5819580a8bac95916ccac3fed/687474703a2f2f677265656e7a6574612e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032342f30332f416c69656e5f5265706f5f5f5468655f4f70656e2d536f757263655f436f736d6f732e706e67" alt="Introductory Comic Strip"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://comicgenerator.greenzeta.com" rel="nofollow noopener noreferrer"&gt;Live Site&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;The Process&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Write a sentence or two describing a premise for the comic strip. GPT, and variaous other AI models, take the premise and write a three panel comic strip describing: dialog, background scenery, and character action. The text description of the background scenery is sent to an image generator to produce background images. The character action is selected from a list of pre-drawn character art featuring &lt;a href="https://greenzeta.com/project/illustrations/" rel="nofollow noopener noreferrer"&gt;Alpha Zeta&lt;/a&gt;, the alien mascot of &lt;a href="https://greenzeta.com" rel="nofollow noopener noreferrer"&gt;GreenZeta.com&lt;/a&gt;. All of these assets are merged together into a comic strip!&lt;/p&gt;
&lt;p&gt;For a more detailed description, check out &lt;a href="https://greenzeta.com/zeta-comics-blending-ai-art-in-digital-stories/" rel="nofollow noopener noreferrer"&gt;Zeta Comics: Blending AI &amp;amp; Art in Digital Stories&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;This Project&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The code in this rep is meant to be an example of interacting with various public AI APIs, as well as rendering a comic strip with JavaScript. It…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mwilber/zeta-comic-generator" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;The Backend&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Given that OpenAI publishes an npm library for interaction with their API, PHP is not the ideal solution. However, my server runs a LAMP stack so, for me, it was the path of least resistance. Fortunately, their API has a REST interface making it accessible from PHP through curl. Using curl isn’t difficult and &lt;a href="https://platform.openai.com/docs/guides/text-generation" rel="noopener noreferrer"&gt;OpenAI’s documentation&lt;/a&gt; provides examples of each call. Since the only thing that changes is the prompt, each GPT call uses the same code. Only minor modifications are needed for Dall-E.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example PHP:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$url = "https://api.openai.com/v1/chat/completions";
$prompt = {GPT PROMPT HERE}

$ch = curl_init();
$headers = array(
 'Authorization: Bearer ' . {OPENAI API KEY HERE},
 'Content-Type: application/json',
);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HEADER, 0);
$body = '{
 "model": "'.OAI_MODEL.'",
            "response_format": { "type": "json_object" },
 "messages": [
  {
   "role": "user",
   "content": "'.$prompt.'"
  }
 ]
}';

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 
curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a cartoonist and humorist.

Write the script for a three-panel comic strip.

In the comic strip, our main character, a short green humanoid alien named Alpha Zeta, engages in the following premise: {Premise}

Include a detailed scene description and words spoken by the main character.
Write your script in the form of a json object. The json object has the following properties: `title` and `panels`.
The following is a description of each property value:
`title`: The title of the comic strip. Limit to 50 letters.
`panels` is an array of objects with the following properties: `scene` and `dialog`
`scene`: A description of the panel scene including all characters.
`dialog`: Words spoken by Alpha Zeta. He is the only character that speaks so there is no need to label with a name. This can be an empty string if the character is not speaking.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All prompts used in the Comic Generator are available to read in the &lt;a href="https://comicgenerator.greenzeta.com/about#ai-prompts" rel="noopener noreferrer"&gt;About page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "title": "Alpha Zeta and the AI Artisan",
  "panels": [
    {
      "scene": "Panel 1 shows Alpha Zeta sitting at a sleek, futuristic computer console...",
      "dialog": "So this AI can draw comics? Let's test its sense of humor with an intro piece!",
    },
    ...
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JSON output, from the model, is sent as a response from the PHP page. Originally, this required a lot of extra work to extract and validate the JSON part of GPT’s output. Fortunately, the introduction of the &lt;code&gt;[response\_format](https://platform.openai.com/docs/api-reference/chat/create#chat-create-response_format)\&lt;/code&gt; parameter now forces GPT to respond only with valid JSON. A makeshift REST api on my end allows the Comic Generator to select each prompt by sending a fetch request to a different url endpoint. e.g. &lt;code&gt;/script\&lt;/code&gt;, &lt;code&gt;/backgrounds\&lt;/code&gt; &amp;amp; &lt;code&gt;/actions\&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Frontend&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The JavaScript front-end manages the entire process, starting with the user’s premise and managing each back-end call in sequence. Interaction with the PHP back-end is done with simple fetch requests, gathering the necessary data. Here’s a glimpse of what the final data object looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "title": "Alpha Zeta and the AI Artisan",
    "panels": [
        {
            "scene": "Panel 1 shows Alpha Zeta sitting at a sleek, futuristic computer console...",
            "dialog": "So this AI can draw comics? Let's test its sense of humor with an intro piece!",
            "background": "A futuristic, minimalist room with sleek surfaces and ambient lighting...",
            "background_url": "...",
            "action": "sitting"
        },
        ...
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the data object is complete, the final comic is assembled. To keep things simple, each comic has exactly three panels and each panel is a perfect square. The dialog balloons are rendered in a &amp;lt;canvas&amp;gt; element and output as an image. The three images: background, character, dialog are stacked on top of each other to form each complete panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yalxjcxmqzk2bp6nhre.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yalxjcxmqzk2bp6nhre.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As AI tools evolve, so will the Zeta Comic Generator. It’s already received improvements in quality through upgrades to GPT and Dall-E. My hope is that one day it will be up to the task of creating episodic storylines with rich continuity. Improvements in the comics won’t be limited to technology, Alpha Zeta’s abilities will also continue to grow as I add new action artwork to the list.&lt;/p&gt;

&lt;p&gt;Try out the &lt;a href="https://comicgenerator.greenzeta.com/" rel="noopener noreferrer"&gt;Zeta Comic Generator&lt;/a&gt; and see your story ideas unfold. As you explore this tool, you’re not just creating comics; you’re part of an exciting journey at the forefront of digital creativity. The future of AI and art is bright and full of potential. Zeta Comic Generator just scratches the surface of what’s possible. &lt;a href="https://comicgenerator.greenzeta.com/generate" rel="noopener noreferrer"&gt;Let your imagination run wild&lt;/a&gt; and be a part of crafting tomorrow’s art landscape!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>javascript</category>
      <category>php</category>
      <category>promptengineering</category>
    </item>
    <item>
      <title>ExoBits NFT</title>
      <dc:creator>Matthew Wilber</dc:creator>
      <pubDate>Sun, 06 Oct 2024 14:21:56 +0000</pubDate>
      <link>https://dev.to/greenzeta/exobits-nft-1edb</link>
      <guid>https://dev.to/greenzeta/exobits-nft-1edb</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/pinata"&gt;The Pinata Challenge &lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;The ExoBits project is an experiment in NFT minting and procedural art. There are 1024 ExoBit keys, each one will generate a unique ExoBit character when plugged into the accompanying web component. The NFT is a combination of a unique key and rendering code stored in an Ethereum contract, with accompanying metadata stored on an IPFS server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://exobitsnft.com/" rel="noopener noreferrer"&gt;The Project Website&lt;/a&gt;&lt;br&gt;
&lt;a href="https://opensea.io/collection/exobits-1" rel="noopener noreferrer"&gt;ExoBits on OpenSea&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mwilber" rel="noopener noreferrer"&gt;
        mwilber
      &lt;/a&gt; / &lt;a href="https://github.com/mwilber/exobits-public" rel="noopener noreferrer"&gt;
        exobits-public
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Contract and mint functionality for exobitsnft.com
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Exobits Data Generation Scripts and Contracts&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;This project contains the scripts and contracts for generating the data for the Exobits NFTs.&lt;/p&gt;
&lt;p&gt;Project website: &lt;a href="https://exobitsnft.com/" rel="nofollow noopener noreferrer"&gt;ExoBitsNFT.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/1eba7d30fa4b1db405ffee226e6821d6944c4df59a1cad326208fd84ccf23211/68747470733a2f2f677265656e7a6574612e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032312f30362f6865726f5f6c61796f75742d31303234783432372e6a7067"&gt;&lt;img src="https://camo.githubusercontent.com/1eba7d30fa4b1db405ffee226e6821d6944c4df59a1cad326208fd84ccf23211/68747470733a2f2f677265656e7a6574612e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032312f30362f6865726f5f6c61796f75742d31303234783432372e6a7067" alt="Exobits Hero Layout"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;contracts/Exobits.sol&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;The public Exobits contract. Published to the Etherium blockchain at address &lt;code&gt;0x5bbec211972328487e8859740aade132ba7a1916&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://etherscan.io/address/0x5bbec211972328487e8859740aade132ba7a1916" rel="nofollow noopener noreferrer"&gt;View on Etherscan&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;server/datagen/mintprep.php&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;This script is called during the minting process to generate the data for the NFTs. The Exobit json file is updated to include the name given to the Exobit at time of purchase and uploaded to IPFS via the Pinata API.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Other Files&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;server/datagen/&lt;/code&gt; directory contains the scripts used to generate the original key values, preview images and placeholder json data for the NFTs. They were run once to generate the 1024 available Exobit keys and are no longer used.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Related Projects&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/mwilber/gz-exobit" rel="noopener noreferrer"&gt;gz-exobit&lt;/a&gt; - Web component for displaying Exobit NFTs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/mwilber/nft-minting-website-example" rel="noopener noreferrer"&gt;nft-minting-website-example&lt;/a&gt; - Example website for minting NFTs. Based off of the ExoBits project website.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mwilber/exobits-public" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  More Details
&lt;/h2&gt;

&lt;p&gt;The Pinata API is used to store the ExoBit data file and preview image on IPFS for viewing in the wallet and third party websites like OpenSea. All 1024 ExoBit keys were generated at the time of the project launch. At that time, preview images were rendered and uploaded with Pinata. When a user purchases an ExoBit, they are required to give it a name. That name is added to the datafile and uploaded via Pinata before minting the key and IPFS address to the Ethereum contract. The pinata upload is done with a curl request to the api from the script &lt;code&gt;server/datagen/mintprep.php&lt;/code&gt; seen in the above repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://greenzeta.com/update/key-generation/" rel="noopener noreferrer"&gt;ExoBit key generation post on greenzeta.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkdjwbwbs2np1rxrx262k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkdjwbwbs2np1rxrx262k.png" alt="A flowchart depicting the interaction between an Ethereum contract, metadata, and a web component. The Ethereum contract contains NFTs and an art generator in JavaScript. The flow shows arrows leading from the contract to both the metadata, which contains a web component URL and an ExoBit key, and to the web component, represented by an ExoBit." width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More information on how ExoBits are minted and rendered on the project website at &lt;a href="https://exobitsnft.com/" rel="noopener noreferrer"&gt;ExoBitsNFT.com&lt;/a&gt; as well as my tutorial &lt;a href="https://greenzeta.com/how-to-build-an-nft-website/" rel="noopener noreferrer"&gt;How To Build An NFT Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>pinatachallenge</category>
      <category>webdev</category>
      <category>api</category>
    </item>
  </channel>
</rss>
