Skip to content

Instantly share code, notes, and snippets.

@deanmlittle
deanmlittle / bitcoin_winternitz_vault.s
Last active December 12, 2025 19:21
Bitcoin Winternitz Vault
/*******************
* UNLOCKING SCRIPT *
*******************/
// Reverse-ordered Winternitz signature scalar and hash offset pairs
<0x6a1e8e25ac52d4073e6e6792deae3dd16d12580130e8fb1338629cf09cde415f> <0x08>
<0x171582236c86aacab7a0bdfde1d841bed34a4c712748b46a141bd9a743cb965a> <0x0a>
<0xc42ebffb891ff91b5cd75c0b2cfa1b1658eb3586bad9a4aaea05a34846765491> <0xf0>
<0x7faa84fe7faa005ebc37f02b15aa8db41c9ed7c63d8480573471533a0c942096> <0xb0>
<0xe7bbce18cacf2dbc2ae36122365462a07850e873e961ec4ea318dc6506498790> <0x15>
@jdh7190
jdh7190 / unlock.js
Created September 10, 2023 11:14
Unlock from hodlocker
const getUTXO = (rawtx, idx) => {
const bsvtx = new bsv.Transaction(rawtx);
return {
satoshis: bsvtx.outputs[idx].satoshis,
vout: idx,
txid: bsvtx.hash,
script: bsvtx.outputs[idx].script.toHex()
}
}
const getRawtx = async txid => {
@n3dst4
n3dst4 / disable-chrome-same-origin.md
Created June 4, 2018 10:38
How to disable same-origin policy (aka CORS checking) in Chrome

You need to run Chrome with two command line flags:

--disable-web-security --user-data-dir

These are kind of documented here: https://peter.sh/experiments/chromium-command-line-switches/

--disable-web-security is the one that turns off the same-origin policy (the name is scarier than the action). Although the docs don't say this, this flag is ignored unless you also specify --user-data-dir. That's because --disable-web-security can be super risky so you shouldn't be surfing in that mode all the time, so Chrome requires you to use an alternative user profile, specified with --user-data-dir. However, you can get away with just giving --user-data-dir and not specifying a dir, and it will use the default one (so you get all your bookmarks, cookies, extension, etc. but --disable-web-security will still feel that honour has been satisfied and tuirn off same-origin policy.

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';