Skip to content

Instantly share code, notes, and snippets.

View nickjuntilla's full-sized avatar

Nicholas Juntilla nickjuntilla

View GitHub Profile
@nickjuntilla
nickjuntilla / Proof of Republic Blockchain Consensus
Created June 7, 2021 00:02
This is a thought about a new kind of consensus algorithm based on both science and politics
Proof of Republic is based on the idea that a consensys should include as much spatial agreement
and political agreement as possible similar to the electoria college of the Unites States.
This takes into Account 2 main factors
-GPS Location
-Population Weight
GPS location can be found by measuring the speed it takes for data to travel between nodes.
The speed it takes for data to travel around the world at the speed of light is known.
@nickjuntilla
nickjuntilla / metadata.json
Last active September 25, 2023 05:53
Commonly used NFT metadata keys
{
// Line breaks look like they might work. They appear in Rarible description
description: 'Friendly OpenSea Creature that \n\nenjoys long swims in the ocean.',
external_url: 'https://openseacreatures.io/3',
image: 'https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png',
// Only makers place seems to use imageUrl
imageUrl: 'https://ipfsgateway.makersplace.com/ipfs/QmZ15eQX8FPjfrtdX3QYbrhZxJpbLpvDpsgb2p3VEH8Bqq',
animation_url: 'ipfs://ipfs/QmcToBg7HX9cigCKoUcYdVWdKhmSBy2DnLRPMG342h2Deu/animation.mp4',
name: 'Dave Starbelly',
title: 'Token Metadata',
@nickjuntilla
nickjuntilla / gist:7aa315d707f4d11fc36f3bfb86791e93
Created March 15, 2025 19:57
Solidity On chain signature verification
/* Signature Verification
# mostly from here https://solidity-by-example.org/signature/
*/
function getMessageHash(
uint256 _nonce,
uint16 _qty
) public pure returns (bytes32) {
return keccak256(abi.encodePacked(_nonce, _qty));
}
const Arweave = require("arweave");
const loadArweaveWallet = () => {
const walletPath = path.join(__dirname, "creds", "wallet.json");
if (!fs.existsSync(walletPath)) {
throw new Error("Arweave wallet file not found at: " + walletPath);
}
return JSON.parse(fs.readFileSync(walletPath, "utf8"));
};
/**
* Google Cloud DNS Manager for WTTP Bridge
*
* This utility can be used to automatically create DNS zones and records
* when users add custom domains to the bridge service. Users can then
* point their domain's nameservers to Google Cloud DNS to get full DNS
* management including A/AAAA records pointing to the bridge server.
*
* Usage:
* const dnsManager = require('./dns-manager');