Skip to content

Collection of libraries for inscribing generative art ordinals on Bitcoin

Notifications You must be signed in to change notification settings

TheWizardsOfOrd/Elements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

The Wizards of Ord

Faster, simpler, cheaper

The Wizards of Ord: Elements are a collection of open source libraries inscribed on Bitcoin through Ordinals Protocol's built-in brotli compression method. This relies on HTTP content-encoding headers for automatically compressing and decompressing data in the browser, resulting in a more efficient use of the expensive Bitcoin blockspace, ease of use, better performance and significant cost savings.

Inscriptions can now use these libraries directly inside their code, without having to explicitly fiddle with compression. As if loading them from a CDN.

Mission

We want to make it easy for anyone and everyone to create art on Ordinals. Are you new to Ordinals? We're here to help. Need to inscribe a library? We'll be happy to inscribe it for you. Have any questions? Hit us up in The Wizards of Ord Discord.

Inscribed libraries

All inscribed libraries are compressed with Ordinals protocol's built-in Brotli compression.

Library Version Release Date Inscription ID Source
p5.js 1.9.2 Mar 19, 2024 7e37766541506810ba6399c4b2735121f508bd9209df43dd200bf2316b014594i0 GitHub
three.js r163 Mar 29, 2024 0d013bb60fc5bf5a6c77da7371b07dc162ebc7d7f3af0ff3bd00ae5f0c546445i0 unpkg
Degenerate Custom Jan 12, 2024 Multiple inscriptions on SAT 45018381985 degenerate
phaser.js 3.80.1 Feb 27, 2024 0d1a04b71975ec948b36cf3ccdff415fca851b9c17144413997395f5ea166e42i0 GitHub

How to use

Caution

Always test before you inscribe

  1. Copy code from Boilerplate. Check examples to see it in action.
  2. Add your generative art code.
  3. Preview your work.
  4. Inscribe using your favorite method, preferrably with compression enabled.

Examples

p5.js

These example inscriptions serve a dual purpose: demonstrate the power of Elements and serve as examples of how to use the inscribed libraries. They use p5.js to apply mempool-like block effect to existing image inscriptions.

three.js

Degenerate

Boilerplate code

Elements provide boilerplate code for creating standalone generative art and collections. Their purpose is to serve as a good starting point for anyone looking to inscribe generative art using Ordinals on Bitcoin.

p5.js

three.js

Degenerate

Caution

Degenerate relies on WebAssembly workers. Due to CSP/iframe issues, they may not show well in preview.

Preview before inscribe

It's always a good idea to preview generative art code before inscribing. The following tool should be useful.

To populate the preview tool with a basic "Hello World" p5.js inscription, click the following link that pre-populates the code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <script src="/content/7e37766541506810ba6399c4b2735121f508bd9209df43dd200bf2316b014594i0"></script>
    <style>
      html, body { margin: 0; padding: 0; }
      canvas { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); }
    </style>
    <meta charset="utf-8" />
  </head>
  <body>
    <script>
      function setup() {
        createCanvas(400, 400);
      }

      function draw() {
        textSize(32);
        fill(0);
        text("The Wizards of Ord", 100, 200);
      }
    </script>
  </body>
</html>

Verify authenticity

You can compare the SHA checksum of the inscribed library and the official library, and verify that they're identical.

$ curl -s https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.2/p5.min.js | shasum
52cc687d6d49e6a5ac135245d3232836233c113b  -

$ curl -s https://ordinals.com/content/7e37766541506810ba6399c4b2735121f508bd9209df43dd200bf2316b014594i0 | shasum
52cc687d6d49e6a5ac135245d3232836233c113b  -

Why Elements over OCM Dimensions?

OCM Dimensions has been incredibly useful in creating genereative art inscriptions on Bitcoin.

However, it predates Ordinals protocols' built-in compression and instead relies on uncompressing on the client side with javascript. This results in larger inscription file sizes and a performance penalty, over Ordinals' built-in compression.

With Dimensions, there's also some additional overhead involved in explicitly compressing the files prior to inscribing. Relying on Ordinals protocols built-in compression avoids that, while making it cheaper to inscribe and have improved performance when loading art inscriptions in the browser.

Moreover, Elements include a more recent version of the inscribed libraries. For example, the inscribed p5.js as a part of Elements is v1.9.0 compared to v1.6.0 with OCM Dimensions.

Downside of Elements? Ordinal's built-in compression is a brand new feature. It might not be widely supported just yet.

Need help?

Join us in The Wizards of Ord Discord and we'll figure it out. Alternatively, tweet @lifofifo on X.

About

Collection of libraries for inscribing generative art ordinals on Bitcoin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published