public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Anthony Towns <aj@erisian•com.au>
To: conduition <conduition@proton•me>
Cc: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Subject: Re: [bitcoindev] OP_CAT Enables Winternitz Signatures
Date: Sat, 5 Jul 2025 22:18:54 +1000	[thread overview]
Message-ID: <aGkYLuZZz2itqVJx@erisian.com.au> (raw)
In-Reply-To: <uCSokD_EM3XBQBiVIEeju5mPOy2OU-TTAQaavyo0Zs8s2GhAdokhJXLFpcBpG9cKF03dNZfq2kqO-PpxXouSIHsDosjYhdBGkFArC5yIHU0=@proton.me>

On Sun, Jun 08, 2025 at 03:20:08AM +0000, 'conduition' via Bitcoin Development Mailing List wrote:
> See a prototype implementation in pseudo-script on
> github here.
> 
> https://gist.github.com/conduition/c6fd78e90c21f669fad7e3b5fe113182

I think you can do the four-bit pair to eight-bit conversion slightly
better with:

DUP 8 GREATERTHANOREQUAL  # is the high-bit going to be set?
SWAP ROT SWAP  # drop that flag lower in the stack
DUP ADD DUP ADD DUP ADD DUP ADD ADD  # combine them mathematically
SWAP IF  # was the flag set?
  128 SWAP SUB  # subtract from 128 converts 0x8100-0xff00 to 0x81-0xff
  IFDUP NOT IF "0x80" ENDIF  # special case 0x80 "negative zero"
ELSE
  IFDUP NOT IF "0x00" ENDIF  # special case actual 0
ENDIF

Should save about 640 bytes of script (11%, 8% total), I think.

> PS If anyone would like to test this on signet, I'd
> be more than happy to help. I couldn't get my OP_CAT
> transactions mined for some reason so i stuck to regtest.

inquisition.bitcoin-signet.net was down for a few days when you posted
this, due to running out of disk space, which probably would have made
getting txs relayed pretty hard. You'd probably have more luck now.

Cheers,
aj

-- 
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups•com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/aGkYLuZZz2itqVJx%40erisian.com.au.


      parent reply	other threads:[~2025-07-05 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-08  3:20 'conduition' via Bitcoin Development Mailing List
     [not found] ` <QcOCx8vBMDuw4xf05H5SbIOPee2MZqV5IQa2opvAXcMeMzzFooHYL97qy5ZCLUEjqXHlHoyAucpmkwwU2i3bhO95SJrWP-oRU6mqamnTvRc=@pm.me>
2025-06-09 15:31   ` 'conduition' via Bitcoin Development Mailing List
2025-07-05 12:18 ` Anthony Towns [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aGkYLuZZz2itqVJx@erisian.com.au \
    --to=aj@erisian$(echo .)com.au \
    --cc=bitcoindev@googlegroups.com \
    --cc=conduition@proton$(echo .)me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox