算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
bitcoin-vaults【设计与创意】Bitcoin vault patterns: timelocked cooldown, hot/cold path with CSV, multisig vaults with quorum reduction over time, OP_VAULT proposal (BIP345), Revault architecture. USE WHEN: designing high-value custody, treasury setups, recovery schemes with publish-and-cooldown semantics.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
A vault enforces a mandatory cooldown between announcing a spend and the spend taking effect. During the cooldown, an alternate "recovery" path can intervene if the spend was unauthorized.
output script (P2WSH):
IF
<DELAY> CSV DROP <hot_pubkey> CHECKSIG # hot path: wait DELAY blocks
ELSE
<cold_pubkey> CHECKSIG # cold path: immediate, alt key
ENDIF
Trade-off: if hot key is compromised AND owner is unavailable for DELAY blocks, attacker wins.
output (Tapscript taptree):
leaf_a: 3-of-3 multisig (everyday quorum)
leaf_b: 144 CSV + 2-of-3 (after 1 day, fewer signers needed)
leaf_c: 4032 CSV + 1-of-3 (after 4 weeks, single signer)
Recovery via gradual quorum reduction. If one key is lost permanently, other keys can recover after timelock.
Revault.dev / Revaultd: multi-stakeholder vault for organizations.
Pre-signed transaction set:
Critical: pre-signing relies on non-malleability of inputs (only SegWit/Taproot inputs).
Native vault primitive: two new opcodes that constrain which outputs a tx can have, enabling first-class vault semantics without script gymnastics.
OP_VAULT (commit to (pubkey, recovery, delay) at output time)
OP_VAULT_RECOVER (immediate recovery to a pre-committed cold script)
A vault output can be spent two ways:
delay,
to a script committed at vault-creation time.Status: proposed, not active. Tested on signets.
Vaults need monitoring: someone must broadcast the cancel/emergency tx if an unauthorized unvault is observed. Two models:
from bitcoinutils.script import Script
vault_script = Script([
'OP_IF',
144, 'OP_CHECKSEQUENCEVERIFY', 'OP_DROP',
hot_pubkey_hex, 'OP_CHECKSIG',
'OP_ELSE',
cold_pubkey_hex, 'OP_CHECKSIG',
'OP_ENDIF'
])
witness = [<hot_sig>, "01"] # "01" = TRUE pushes IF branch
Sequence on input must be ≥ 144 (relative locktime).
witness = [<cold_sig>, "00"] # "00" = FALSE pushes ELSE branch
Immediate, no sequence requirement.
tx.version >= 2 for relative locktimes (BIP68
requirement).