Skip to content

Instantly share code, notes, and snippets.

View JSeam2's full-sized avatar
💭
UwU

Jseam JSeam2

💭
UwU
View GitHub Profile
@JSeam2
JSeam2 / onchain_callback_2.py
Created December 13, 2024 19:14
SetLTV with EZKL
import requests
def main():
# gen-witness and prove
try:
res = requests.post(
url="https://archon-v0.ezkl.xyz/recipe",
headers={
"X-API-KEY": "CHANGE_ME",
"Content-Type": "application/json",
@JSeam2
JSeam2 / onchain_callback.py
Created December 13, 2024 18:48
Onchain Callbacks with EZKL
import requests
def main():
# gen-witness and prove
try:
res = requests.post(
url="https://archon-v0.ezkl.xyz/recipe",
headers={
"X-API-KEY": "REPLACE_ME",
"Content-Type": "application/json",
@JSeam2
JSeam2 / twap.py
Created December 8, 2024 10:41
Simple TWAP script with CCXT
import ccxt
import time
from datetime import datetime
import math
import logging
from typing import Dict, Optional, Literal
# Configure logging
logging.basicConfig(
level=logging.INFO,
@JSeam2
JSeam2 / gpg-decrypt.sh
Created January 15, 2024 20:40
Decrypt an AES256 digest with GPG
gpg --output secrets.out -d secrets.gpg
gpgconf --reload gpg-agent
@JSeam2
JSeam2 / gpg-encrypt.sh
Created January 15, 2024 20:39
Encrypt with GPG using AES256
gpg --output secrets.gpg --symmetric --no-symkey-cache --cipher-algo AES256 secrets
@JSeam2
JSeam2 / CryptoIdol_v0_2.sol
Created July 7, 2023 12:52
Smart contract for cryptoidol, v0.2
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
interface Verifier {
function verify(
uint256[] memory pubInputs,
bytes memory proof
) external view returns(bool);
}
@JSeam2
JSeam2 / gelkin explained.md
Created March 5, 2023 13:34
more about gelkin

Gelkin Explained

Smart contracts on the EVM are very limited. This makes it challenging to create applications that require more compute and data beyond the state of the blockchain. Furthermore, data is mostly public, making it difficult to remain private. ZKP (Zero Knowledge Proofs) offer a way to scale Ethereum and help offer privacy where needed. However, writing custom circuits novel applications is difficult.

Using machine learning, developers don't need to write custom circuits and can specify intended behaviors and have a computer learn the circuit. Leveraging on the EZKL library, Gelkin helps developers extend their smart contracts with ZKML (Zero Knowledge Machine Learning). Developers can then extend their smart contracts by leveraging on existing verifiers or by deploying verifiers themselves through the service.

Through Gelkin, EZKL, and ZKML, smart contracts will be able to offer more complex functionality like:

On-chain credit scoring to offer more kinds of DeFi loan arrangements

Anomaly d

Sponsor Bounty Explanations

Covalent Unified API Endpoints

Covalent API was used to help provide data to train the ML models using the Gelkin

Developer Infrastructure/Tooling Mantle

Gelkin allows developers to deploy ZKML verifiers on Mantle network

Build on Pokt Network

Gelkin uses Pokt Network RPC endpoints to deploy the ZKML verifiers

@JSeam2
JSeam2 / Recover_Account.py
Created October 25, 2021 07:41
Recover eth account on web3.py signed with signMessage() on ethers.js
import web3
w3 = web3.Web3()
prefix = "\x19Ethereum Signed Message:\n"
message = "Verify your Eth address. zveyIPmNyiaCNRjJ9hsbYqEJPb7gJTgNzm2ybM_F-SQ"
signed = "0x4481dffa200bc4c9cadad4083002585fbe20aebef1916aa7d58e66682860097747df3f7fb608c30ff19adbf52ab4ef2a8eabb553857373b0767d43afd83f09ea1c"
prefix = w3.toBytes(text=prefix)
msg = w3.toBytes(text=message)
@JSeam2
JSeam2 / Token_wrapper.sol
Created May 21, 2021 14:14
Token Wrapping
contract ERC20Wrapper is ERC20, ERC1155Receiver {
uint256 public tokenId;
IShareToken public shareToken;
IERC20 public cash;
address public augurFoundry;
/**
* @dev sets values for
* @param _augurFoundry A trusted factory contract so that users can wrap multiple tokens in one
* transaction without giving individual approvals