Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tunnckoCore's full-sized avatar
🔒
Fighting for freedom, security and privacy 🔐

Charlike Mike Reagent tunnckoCore

🔒
Fighting for freedom, security and privacy 🔐
View GitHub Profile
@tunnckoCore
tunnckoCore / README.md
Last active March 17, 2024 08:45
Track Ethereum Blob Transactions with Viem

Just import and call trackBlobs(handler).

import { trackBlobs, onlyDataURIBlobs } from './pkg';

await trackBlobs(({ parentBlockSlotHash, block, blobTransactions, blobs }) => {
  const { dataBytes } = onlyDataURIBlobs({ blobs });
 
@tunnckoCore
tunnckoCore / blobs-utils.mjs
Created March 14, 2024 19:57
Ethereum Blobs Utils
import { bytesToString, hexToBytes } from 'viem';
export async function getBlobMeta(hash) {
let result = {};
try {
const res = await fetch(getBlobUrl(hash)).then((x) => x.json());
if (res.error) {
result.error = res.error;
@tunnckoCore
tunnckoCore / mongo-like-filters.ts
Created February 26, 2024 22:20
mongo like filters for javascript objects
function getAttribute(obj: any, key: any) {
const parts = key.split(".");
for (let _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
const k = parts_1[_i];
if (obj !== null && typeof obj === "object" && k in obj) {
obj = obj[k];
} else {
obj = undefined;
@tunnckoCore
tunnckoCore / EthsBidding.sol
Last active September 1, 2023 22:02
Ethscriptions Bidding solution
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.21;
// Author: wgw.eth / wgw.lol / tunnckoCore
// Date: August 2023
contract EthsBidding {
struct Offer {
bytes32 bidTxHash;
bytes32 ethscriptionId;
@tunnckoCore
tunnckoCore / name-service-resolver.js
Created August 14, 2023 06:32
Ethscriptions hosting & resolving domains (handles/words/ens), not just "user profiles" with `application/vnd.esc.user.profile+json`
import { verifyMessage } from "viem";
/**
* Ethscriptions Hosting & Resolving of ens domains & ethscriptions handles eg. `data,hirsch`
*
* `data:application/vnd.esc.wgw.deploy.`
* -> hex = 646174613a6170706c69636174696f6e2f766e642e6573632e7767772e6465706c6f792e
*
* `+json`
* -> hex = 2b6a736f6e
[
{
"hex": "#f0f8ff",
"name": "aliceblue"
},
{
"hex": "#faebd7",
"name": "antiquewhite"
},
{

New (old) Way of Trading.

I think I solved the problem of safe #Ethscriptions trading.

A multi step process, but safe and sane. Basically, offers-based.


1/ Here's how it could work:

@tunnckoCore
tunnckoCore / EthscriptionsMarketplace.sol
Last active July 10, 2023 16:11
Fully customizable on-chain Ethscriptions Marketplace in 350 lines of Solidity!
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.18;
// Fully on-chain, fully customizable, Ethscriptions Marketplace
// Info: ethscriptions.com
// Author: @tunnckoCore / wgw.eth / Sigma Wolf
// Date: June 29, 2023
error NotAdmin();
error NotAdminOrPaymentAddress();
@tunnckoCore
tunnckoCore / ord721-types.ts
Last active June 22, 2023 06:10
ORD-721 protocol - TypeScript types, Zod Schemas, zod inferred typescript types
export type ORD721RoyaltyType = {
address: string;
amount: number;
token: string;
type?: string;
};
export type ORD721RoyaltyManifestType = {
protocol: { name: "ORD721"; version: string; type: "royalty" };

ORD-721 was started around the same time when BRC-721 was started, about 3 months ago.

Differences are mostly technical, and that BRC-721 is promoting off-chain data. Ord-721 support both off-chain and on-chain, but recommending on-chain. It's easy to add a "fallback" link image to HQ but you should at least own/have some content.

Neither are visible on the ord wallet, or on other wallets and marketplaces, for now.

Ord721 has more structure and can define many things on the Collection Manifest inscription - which plays as the source of truth for a collection. Things like name, description, max supply, mint price, and optionally royalties definition, website, twitter and etc stuff if creator decides. Brc721 doesn't support much of that, at least such things won't be on the collection definition.

Each item of a collection is called Token Manifest, in which both the content (image, svg, html, or anything), and the metadata (like traits/attributes, and token id) are in one place - the content insi