Delivery-date: Mon, 18 Nov 2024 10:36:49 -0800 Received: from mail-qt1-f185.google.com ([209.85.160.185]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tD6cD-0007Jy-F0 for bitcoindev@gnusha.org; Mon, 18 Nov 2024 10:36:49 -0800 Received: by mail-qt1-f185.google.com with SMTP id d75a77b69052e-460a85907b7sf43129171cf.0 for ; Mon, 18 Nov 2024 10:36:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731955003; cv=pass; d=google.com; s=arc-20240605; b=LYP/BmvH4ygxmWqAirS2vf3Mp1z3Og0JhVnUQJ5oo+2qgqBOV3bMM07pE5n9BFjsgC qZIV7BGtWpWj7PO5wmIFxH/iEfb2gFt9A1J5wT8z7nO6dsKX8EmRdF2CGcEwKzUsWslr m7YgGilFr6q/R9PVTESDrCRecdIUibk0VROVAJCgvm/n2FKO4rlm2aIo2w+DLufguBre nZ0Y34fV6Aayc2kd3u8Zen9Qx2Ikn/AZUvku2faL4xZ2YyU/kABllVs+0zDRq/WzOjLx tCB8/EZ2pf5BXPcO0R/adUu77Up6DPNLEhtHYxwvXmC8hoDOT1PbgTLzcqlpgMwLTTMF oh2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :dkim-signature; bh=lYg8pNeVG45ROJTcFMKLzr19AUzK+IS4PNqofvJa0Og=; fh=xSeKHUJHoSuO0dBqUqPGMaLLFacvCx7W8dldS+nk0ng=; b=gZtAOw8oTSAmgjUkk/DiVXy70UycWWj5gRLTJdeSrvs+mI8wkg1oSzEEIwMGsbjN4x TFugb+VGZ1JWG5dc8QJ3Bq7wnwlI4UxRnnCzgp5fn/231Hp80GXJ6edHvuPy0KrXJ66G Po40g9Ek7vgOknmC45n4djR4UX6mymIycM8hdISttMKVGBv6Z1dvNsgs3zMd9ygtjB31 PiXSRYnW20u9cGYHtBmfXoJLehI1Xepnj4z9cEv31/Uk/8uPu1V8uMMqSDYgsJcI4dRd bAifL8wU51UeTMApgXkLCViDyjdpOyR2TpCP+hIlWCSNbxpo9BRc5Zer8bOLMvcrn1q8 5WCQ==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@reardencode.com header.s=mail header.b="Bh0djuu/"; spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1731955003; x=1732559803; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=lYg8pNeVG45ROJTcFMKLzr19AUzK+IS4PNqofvJa0Og=; b=VfPhpSyMSVn5jS70ztt6qvr+G3k+UQOIDicNC9gRRBuxksAE/MNqUBFV8wfaxzu77j CAoXvlLZxAmrofd37OXg41uL22ulapsFaoIKbZEhvNMwbtMXe7jBvm7J2BkhP8WdyBlz Q+zhu5MFm95Yz45nJqd3+Po4qyr+yWgrLRwisJkHbD6MWIKgsgwT3+UVl7a06u+8ij0Q sahHAfD/CwKBV3yGqItEhBzUOutVkDv/ZNzHSrDGbgensZySk7LFwQDmwHh3S4A11Rns a6CJKwBZ51IPAwC/Wj5q6vQqwoljeoI75Rh3GepG8PIxzQ4GX7NNe4ayVTAwvBcs/7pq BEtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731955003; x=1732559803; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=lYg8pNeVG45ROJTcFMKLzr19AUzK+IS4PNqofvJa0Og=; b=D858yUQ+e6Verq0vQ6wQ6bi3d3haEBHoGrlwYXe3JeDNCM0iM/KBkMdOIAzPiiFJGC nmhJIuta1yrxX8Xcd89KSxm0vQ9kaGyht0jFPJ0MuEC2LgCl6yh8HGkibsG4IHJNEpgw 0lcC2lFsXVE29ZcXEgFLYOJjlhC1RdFx7PaUpsZaQMq5F1AJAHyktUDMTY7Xkhi3epcF 7TqGpriqQj2Yf3b8l+Ms3Lqghm3uByvI0wk3ueiy19lBCAj0Y6f/cYderMpDnAvrL4QH sdTRw777j6pCISETLsVs8Xj+bj6TEYobWeZRz5tKwwtsKg1fM+IytMFbOFAWPGnPq+Jg L3zw== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUtIO6hXXzJwJiJ4pfYeJ1X5fMAhU9tdxhOKl8ns3dJkgEgqSfnKb8bkON8+OWN+lod7GLDjWfJUlEv@gnusha.org X-Gm-Message-State: AOJu0Yw7khV3hb2kGT5oJ5UHU4PExjd5tBXfnTaEDF6iyZzsIDzbSSsg VOZ4Ax0EPwqjMzsUqVJ8ribCh5vsO8F5IBJLEfRIcbLSi8St5lII X-Google-Smtp-Source: AGHT+IEXrVuYYyP92RWGpP42MJhckm0t+/PIUqJjlR4eZA9XJ6e5Y27R0b192KjNrJVLG3DMp9PJnA== X-Received: by 2002:ac8:7d82:0:b0:461:5770:cbd3 with SMTP id d75a77b69052e-46363e2db28mr182941771cf.30.1731955002650; Mon, 18 Nov 2024 10:36:42 -0800 (PST) X-BeenThere: bitcoindev@googlegroups.com Received: by 2002:ac8:5845:0:b0:460:e9a4:81fc with SMTP id d75a77b69052e-463705923dfls17482251cf.2.-pod-prod-06-us; Mon, 18 Nov 2024 10:36:40 -0800 (PST) X-Received: by 2002:a05:620a:198e:b0:7b1:8e09:513a with SMTP id af79cd13be357-7b362361bfamr1975497285a.49.1731955000419; Mon, 18 Nov 2024 10:36:40 -0800 (PST) Received: by 2002:a05:620a:111c:b0:7a1:d643:94b4 with SMTP id af79cd13be357-7b361857bafms85a; Mon, 18 Nov 2024 09:16:16 -0800 (PST) X-Received: by 2002:ad4:5747:0:b0:6d4:76a:d966 with SMTP id 6a1803df08f44-6d4076adacbmr181872466d6.21.1731950175189; Mon, 18 Nov 2024 09:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731950175; cv=none; d=google.com; s=arc-20240605; b=HLvNcLc9fBv7XJ30YK6ryaSHC39Y4y8tzOFowJx5WiYJTO1FBWzBL+qexmBFDI2HFh w7HwMK4kXsREX0O1Evk44AFAKzhzvMkbRV6P5RQ+kXfONdhgo5fGfxEScvG9n+SvsrGi NzyHRtsCO4PjwxRbOL2QpzybQkr3+POOdM2Uc7fa+QTlU/+5IEvnCgZb+oVWaWP9UbWq om20GXOTzpVxghziFRNJ1klBGt0n/vP/m7M+fSFzkkl7CYP/aL/ecpqY+Va9ivV5KgpM CxJYPnB/VkSXk40KUkN/mYWSkUxC+joDDTEYE0W2PsJK2XM3t0xDTgD3exh/7njwAOyi htPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:dkim-signature:date; bh=O3YcniGvVw0dZSwQyYN8XcQApBw5vdFkrt06awc7XoM=; fh=l2PY1G398ajio4qyQwxEGOPwP8x/gfFd/1h2ck8j9ZA=; b=dl2VcvdxutTzhfuaraciNonRhfBkVNYWD0wQ3FDv/npdOpZ0IYy8bf2RUG0scANcx0 6j8dhuWmtgeqn3V2uWikuLepnzLUkta34Ty5t+v08O76/zb7rh901Xny8mvN2UNASymO WMNmfOYu4hKTHdYkjuuoVYpFFlI+TlhVjo3X6B2WOTwLJveWky62ZbttqikxTNJPRBu2 yGVzvJQjfGybGkn5AiN4ewM8kMRzF3Y+mili/3mszGGJsYUdMeX6mAze6UjDU37irKQJ WWa+uatmbvCWux3HByZH5yVfvK/q3Djjdnnf/hUlCNXG19Hz9PDD8dndD/N+ftuyf57U W42A==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@reardencode.com header.s=mail header.b="Bh0djuu/"; spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com Received: from mail.reardencode.com ([2607:f2f8:ad40:ea11::1]) by gmr-mx.google.com with ESMTPS id 6a1803df08f44-6d40db8cc2asi2155706d6.1.2024.11.18.09.16.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 09:16:13 -0800 (PST) Received-SPF: pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) client-ip=2607:f2f8:ad40:ea11::1; Date: Mon, 18 Nov 2024 09:15:36 -0800 From: Brandon Black To: Weikeng Chen Cc: Bitcoin Development Mailing List Subject: Re: [bitcoindev] Multi-byte opcodes Message-ID: References: <4235f7d2-8e09-428a-813d-9034cb21f48an@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <4235f7d2-8e09-428a-813d-9034cb21f48an@googlegroups.com> X-Operating-System: Linux 6.6.36 x86_64 X-Original-Sender: freedom@reardencode.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@reardencode.com header.s=mail header.b="Bh0djuu/"; spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.8 (/) Hi Weikeng, thanks for your thoughts on this! > We can, however, solve that by allowing multi-byte opcodes. > > Say, for example, we can have: > OP_OP { 0x1521 } > which will set the current opcode to be the one with the assigned number > 0x1521. > > Another idea is maybe OP_OP takes a stack element as the opcode. > { 0x1521 } OP_OP Another option that works for many cases is to have opcode families where an argument is augmented with flags to determine the behavior. We can consider this to already be the case for OP_CHECKSIG* where the signature determines the behavior of the hashing portion of the opcode. This is also how OP_CHECKTEMPLATEVERIFY is designed, and how OP_CHECKSIGFROMSTACKVERIFY as currently spec'd in the PR is designed. CTV and CSFSV only constrain 32-byte first arguments, but not other lengths leaving open extensions using any other length, including using other lengths of either opcode as OP_OP, or as variants on CTV and CSFSV respectively. The benefit of this approach is that it doesn't "waste" the length byte only to specify the opcode behavior, but enables it to do double duty as specifying the total length of the first argument including both flags and data. Best, --Brandon -- 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/Zzt2OCE6Aj9H3DiY%40console.