Hi spartacusrex, thanks for raising this point.
The current published version of SHRINCS (
described here) is not the version which we'll end up proposing for Bitcoin. As you point out, SHRINCS v1 doesn't give signers any flexibility in the stateful signing path to handle alternative use-cases. Since I started working with the blockstream folks, I think we've all come to agree this is a potentially important feature for some use-cases, that ought to be available. Some use cases would prefer constant-size signatures with higher stateful signing budgets. We don't want to force signers who
can keep track of state to use the stateless path and waste blockspace unnecessarily.
Our current working design (unpublished) uses a flexible XMSS structure where signers can choose to use a balanced or an unbalanced XMSS tree structure in their stateful signing path, with the consensus-verifier being flexible enough to accept either format without distinguishing (i.e. a signature from a balanced depth 8 XMSS tree is indistinguishable from the 8th signature of an unbalanced tree).
As for multi-tree support, that is still uncertain. The main use-case for multi-tree XMSS would be lightning - nobody else ever needs to sign so much that they'd need multiple stateful trees, and if they do they can use the stateless path. We're still too early in the design process to say for sure if multi-tree is necessary, but I personally suspect it'd be better implemented as an entirely separate scheme from SHRINCS.
For now we're still writing the spec and putting in the work to make sure it's secure, but stay tuned for updates. We'll publish the new & improved SHRINCS scheme here and on DelvingBitcoin when it's ready for public review :)
I designed, wrote and work on a blockchain that implements WOTS sigs as standard so have some real-world knowledge of how this plays out in a live environment.
First - keeping the state is non-trivial. This is MUCH harder for Users than I expected.
I'd love to hear more about your experience with this. You mentioned wallet restoration as the main pain point, but are there any other issues you've run into deploying stateful signatures in the wild?
If possible, would you be able to share the docs/specs/standards that you worked on?
- Creating SPHINCS sigs is a lot more resource intensive than WOTS.- RAM usage is 100x more ( not soo bad )
- SPHINCS sigs are BIG. ~20kb. Bigger than a regular WOTS sig and MUCH bigger than regular BTC sigs .
- Real issue is that on a phone the SPHINCS sig can take 20-30 seconds to create. Verification is still fast - just checking some merkle branches and WOTS sigs.
Sounds like you might have some places to optimize.
What you need is :
- An OP_ for general Merkle branch checking. You need to use a HASH-SUM tree for SPHINCS.. so you can tell which HORS set you are using (technical point).
- An OP_ for WOTS check
..
- An OP_ for SPHINCS checking - which you _could_ actually create in script using the first 2 ops but a single OP_ would be cleaner/faster.
We considered the option of implementing different SHRINCS sub-components as distinct opcodes/schemes in script. We decided not to, because of how challenging it would be to implement secure multisignature scripts. You'd have to handle the combinatorial explosion that occurs if different signers want to use different signing paths in the same witness. It's better if we have one unified standardized scheme which signers can customize on the client-side if they need to. Scripts should be kept clean and any new signature scheme should be compartmentalized.
regards,
conduition