Skip to content

Instantly share code, notes, and snippets.

View pnowosie's full-sized avatar

Pawel Nowosielski pnowosie

View GitHub Profile
@pnowosie
pnowosie / FINDINGS.md
Last active February 19, 2026 20:52
1cart Webhook Signature Verification

1cart Webhook Signature Verification — Findings

Reverse-engineered from real 1cart events. The PHP SDK source CallbackReceiver.php was used as a starting point, but several implementation quirks required brute-force discovery.


Digest (Digest header)

@pnowosie
pnowosie / Makefile
Created July 5, 2023 16:05
Syncing Ethereum (Gnosis)
# Syncing Gnosis network
# I've just followed [Gnosis Interactive Guide](https://docs.gnosischain.com/node/guide/)
#
# Prerequisities:
# - Folders `../layers/cons` & `../layers/exec` containing appropriate client binaries
#
# How to run
# - make [setup]
# In 2 separate terminal windows run:
# - make run-el
@pnowosie
pnowosie / do_test.js
Created February 8, 2023 13:27
Truffle quick-setup files
const { toBN } = require("web3-utils/src/utils");
const BHAddr = '0x0100000000000000000000000000000000000000';
const IPAddr = '0x010000000000000000000000000000000000000c';
const toAddr = '0xf126b50def52da277d80c9cfa542811e8452c60c'
const buf = Buffer.alloc(32, 0);
// Slot 1
buf[0] = 1
const Slot1 = '0x'+buf.toString('hex')
@pnowosie
pnowosie / kopernikus.json
Last active February 6, 2023 15:11
Local 2 nodes setup - helpers
{
"networkID": 1002,
"camino": {
"verifyNodeSignature": true,
"lockModeBondDeposit": true,
"initialAdmin": "X-kopernikus1g65uqn6t77p656w64023nh8nd9updzmxh8ttv3",
"depositOffers": [
{
"interestRateNominator": 80000,
"startOffset": 0,
@pnowosie
pnowosie / do_test.js
Created November 24, 2022 11:30
Camino rewards collection test script for truffle
// Run: `truffle exec do_test.js`
const { toBN } = require("web3-utils/src/utils");
const BHAddr = '0x0100000000000000000000000000000000000000';
const IPAddr = '0x010000000000000000000000000000000000000c';
const toAddr = '0xa2AA6EbD9029F2c1498bD6ee1d1F6708Fd2A1e0b'
const buf = Buffer.alloc(32, 0);
// Slot 1
buf[0] = 1

Hardware wallet - recover private keys

Abstract

I lost one of my Ledger devices, back in 2018. Situation which might be the worst nightmare for many teaches me how to recover my private keys without waiting for a new device.

Please DO NOT follow this advice with your own recovery phrase just to confirm your addresses. There is a reason Ledger and similar security focused companies advices to never input your recovery phrase into internet-connected devices. However, I encourage you to try replicate my results on the zero-seed which is presented bellow.

@pnowosie
pnowosie / hd-wallets-generated-accounts.md
Created June 18, 2022 19:25
Hardware wallet, key generation and restoration to metamask

Hardware wallets, accounts and addresses

Abstract

In this article I will teach you everything I learnt about HD wallet (in my case Ledger). I lost one of my devices, back in 2018 and I was able to restore my Ethereum account in Metamask immediately without waiting for the new device delivery.

You will also learn how to setup you device to give no information about your crypto assets being forced to unlock your HD wallet, e.g. on the airport.

[
{
"ParameterKey": "Project",
"ParameterValue": "memes-generator"
},
{
"ParameterKey": "SharedStage",
"ParameterValue": "shared-dev"
},
{
@pnowosie
pnowosie / Makefile
Last active June 7, 2021 12:05
Makefile - Parameters
# Don't fear the Makefile
# ...but learn to used it efectively
InMakeVar = "Make var"
FromEnvWithDefault ?= "default from make"
before_var = "something"
all:
echo "Zmienna zdefiniowana w env vars: $${HOME}"
@pnowosie
pnowosie / setup-kvm.sh
Created May 31, 2021 20:24
Golem provider kvm user setup
#! /bin/bash
u=$1
[ "$UID" = 0 ] || {
exec sudo "$0" "$USER"
exit 1
}
function is_user_ingroup() {