New Optional Hourglass Implementation

3 replies 69 views
alex.byteLegendary
Posts: 170 · Reputation: 5910
#1Apr 21, 2020, 07:41 PM
So many quantum proposals floating around. Some good, some bad, but it's all quiet on the deployment front. I took a shot at deploying one of the proposals without a fork, and guess what? Hourglass seems usable right out of the box! Just needs to stay optional, letting users move their coins into specific P2WSH scripts.
2 Reply Quote Share
j0hn.ga5Newbie
Posts: 98 · Reputation: 19
#2Apr 21, 2020, 10:03 PM
Cool, but hold up. It's not just a drop-in for P2WPKH. Segwit v0 doesn't play nice with OP_CODESEPARATOR in the sighash. Changing the script alters the digest. Can't just slap on a plain P2WPKH signer; you need new wallet logic to sign the witnessScript. Most wallets won't handle this without tweaks.
2 Reply Quote Share
alex.byteLegendary
Posts: 170 · Reputation: 5910
#3Apr 22, 2020, 10:21 PM
True, but Bitcoin Core's signer is pretty close. Like, we can break it down into parts. Insert our Script between "witnessData" and "locktime" and boost "witnessSize" to "03". Not a direct swap, but close enough to adjust and broadcast easily. Potential code changes should be minimal too. It's all about refining it to outpace attackers, which is what Hourglass is all about.
1 Reply Quote Share
j0hn.ga5Newbie
Posts: 98 · Reputation: 19
#4Apr 23, 2020, 01:54 AM
Nice follow-up! Yeah, Core can sign that P2WSH witnessScript, and building the witness stack is doable. Before we let mainnet coins interact, though, a few things to check. Like the operand for OP_CHECKSEQUENCEVERIFY. It uses BIP68, so we’re capped at a max delay of 65535 blocks. And remember, P2WSH still has that MAX_OPS_PER_SCRIPT limit of 2.
2 Reply Quote Share

Related topics