Skip to main content

Op

Enum Op 

Source
#[repr(u8)]
pub enum Op {
Show 181 variants Op0 = 0, OpPushData1 = 76, OpPushData2 = 77, OpPushData4 = 78, Op1Negate = 79, OpReserved = 80, Op1 = 81, Op2 = 82, Op3 = 83, Op4 = 84, Op5 = 85, Op6 = 86, Op7 = 87, Op8 = 88, Op9 = 89, Op10 = 90, Op11 = 91, Op12 = 92, Op13 = 93, Op14 = 94, Op15 = 95, Op16 = 96, OpNop = 97, OpVer = 98, OpIf = 99, OpNotIf = 100, OpVerIf = 101, OpVerNotIf = 102, OpElse = 103, OpEndIf = 104, OpVerify = 105, OpReturn = 106, OpToAltStack = 107, OpFromAltStack = 108, Op2Drop = 109, Op2Dup = 110, Op3Dup = 111, Op2Over = 112, Op2Rot = 113, Op2Swap = 114, OpIfDup = 115, OpDepth = 116, OpDrop = 117, OpDup = 118, OpNip = 119, OpOver = 120, OpPick = 121, OpRoll = 122, OpRot = 123, OpSwap = 124, OpTuck = 125, OpCat = 126, OpSplit = 127, OpNum2Bin = 128, OpBin2Num = 129, OpSize = 130, OpInvert = 131, OpAnd = 132, OpOr = 133, OpXor = 134, OpEqual = 135, OpEqualVerify = 136, OpReserved1 = 137, OpReserved2 = 138, Op1Add = 139, Op1Sub = 140, Op2Mul = 141, Op2Div = 142, OpNegate = 143, OpAbs = 144, OpNot = 145, Op0NotEqual = 146, OpAdd = 147, OpSub = 148, OpMul = 149, OpDiv = 150, OpMod = 151, OpLShift = 152, OpRShift = 153, OpBoolAnd = 154, OpBoolOr = 155, OpNumEqual = 156, OpNumEqualVerify = 157, OpNumNotEqual = 158, OpLessThan = 159, OpGreaterThan = 160, OpLessThanOrEqual = 161, OpGreaterThanOrEqual = 162, OpMin = 163, OpMax = 164, OpWithin = 165, OpRipemd160 = 166, OpSha1 = 167, OpSha256 = 168, OpHash160 = 169, OpHash256 = 170, OpCodeSeparator = 171, OpCheckSig = 172, OpCheckSigVerify = 173, OpCheckMultiSig = 174, OpCheckMultiSigVerify = 175, OpNop1 = 176, OpNop2 = 177, OpNop3 = 178, OpSubstr = 179, OpLeft = 180, OpRight = 181, OpLShiftNum = 182, OpRShiftNum = 183, OpNop9 = 184, OpNop10 = 185, OpNop11 = 186, OpNop12 = 187, OpNop13 = 188, OpNop14 = 189, OpNop15 = 190, OpNop16 = 191, OpNop17 = 192, OpNop18 = 193, OpNop19 = 194, OpNop20 = 195, OpNop21 = 196, OpNop22 = 197, OpNop23 = 198, OpNop24 = 199, OpNop25 = 200, OpNop26 = 201, OpNop27 = 202, OpNop28 = 203, OpNop29 = 204, OpNop30 = 205, OpNop31 = 206, OpNop32 = 207, OpNop33 = 208, OpNop34 = 209, OpNop35 = 210, OpNop36 = 211, OpNop37 = 212, OpNop38 = 213, OpNop39 = 214, OpNop40 = 215, OpNop41 = 216, OpNop42 = 217, OpNop43 = 218, OpNop44 = 219, OpNop45 = 220, OpNop46 = 221, OpNop47 = 222, OpNop48 = 223, OpNop49 = 224, OpNop50 = 225, OpNop51 = 226, OpNop52 = 227, OpNop53 = 228, OpNop54 = 229, OpNop55 = 230, OpNop56 = 231, OpNop57 = 232, OpNop58 = 233, OpNop59 = 234, OpNop60 = 235, OpNop61 = 236, OpNop62 = 237, OpNop63 = 238, OpNop64 = 239, OpNop65 = 240, OpNop66 = 241, OpNop67 = 242, OpNop68 = 243, OpNop69 = 244, OpNop70 = 245, OpNop71 = 246, OpNop72 = 247, OpNop73 = 248, OpSmallData = 249, OpSmallInteger = 250, OpPubKeys = 251, OpNop77 = 252, OpPubKeyHash = 253, OpPubKey = 254, OpInvalidOpcode = 255,
}
Expand description

All BSV script opcodes with their byte values.

Variant names use TS-SDK style: Op::OpDup, Op::OpCheckSig, etc.

Variants§

§

Op0 = 0

§

OpPushData1 = 76

§

OpPushData2 = 77

§

OpPushData4 = 78

§

Op1Negate = 79

§

OpReserved = 80

§

Op1 = 81

§

Op2 = 82

§

Op3 = 83

§

Op4 = 84

§

Op5 = 85

§

Op6 = 86

§

Op7 = 87

§

Op8 = 88

§

Op9 = 89

§

Op10 = 90

§

Op11 = 91

§

Op12 = 92

§

Op13 = 93

§

Op14 = 94

§

Op15 = 95

§

Op16 = 96

§

OpNop = 97

§

OpVer = 98

§

OpIf = 99

§

OpNotIf = 100

§

OpVerIf = 101

§

OpVerNotIf = 102

§

OpElse = 103

§

OpEndIf = 104

§

OpVerify = 105

§

OpReturn = 106

§

OpToAltStack = 107

§

OpFromAltStack = 108

§

Op2Drop = 109

§

Op2Dup = 110

§

Op3Dup = 111

§

Op2Over = 112

§

Op2Rot = 113

§

Op2Swap = 114

§

OpIfDup = 115

§

OpDepth = 116

§

OpDrop = 117

§

OpDup = 118

§

OpNip = 119

§

OpOver = 120

§

OpPick = 121

§

OpRoll = 122

§

OpRot = 123

§

OpSwap = 124

§

OpTuck = 125

§

OpCat = 126

§

OpSplit = 127

§

OpNum2Bin = 128

§

OpBin2Num = 129

§

OpSize = 130

§

OpInvert = 131

§

OpAnd = 132

§

OpOr = 133

§

OpXor = 134

§

OpEqual = 135

§

OpEqualVerify = 136

§

OpReserved1 = 137

§

OpReserved2 = 138

§

Op1Add = 139

§

Op1Sub = 140

§

Op2Mul = 141

§

Op2Div = 142

§

OpNegate = 143

§

OpAbs = 144

§

OpNot = 145

§

Op0NotEqual = 146

§

OpAdd = 147

§

OpSub = 148

§

OpMul = 149

§

OpDiv = 150

§

OpMod = 151

§

OpLShift = 152

§

OpRShift = 153

§

OpBoolAnd = 154

§

OpBoolOr = 155

§

OpNumEqual = 156

§

OpNumEqualVerify = 157

§

OpNumNotEqual = 158

§

OpLessThan = 159

§

OpGreaterThan = 160

§

OpLessThanOrEqual = 161

§

OpGreaterThanOrEqual = 162

§

OpMin = 163

§

OpMax = 164

§

OpWithin = 165

§

OpRipemd160 = 166

§

OpSha1 = 167

§

OpSha256 = 168

§

OpHash160 = 169

§

OpHash256 = 170

§

OpCodeSeparator = 171

§

OpCheckSig = 172

§

OpCheckSigVerify = 173

§

OpCheckMultiSig = 174

§

OpCheckMultiSigVerify = 175

§

OpNop1 = 176

§

OpNop2 = 177

§

OpNop3 = 178

§

OpSubstr = 179

§

OpLeft = 180

§

OpRight = 181

§

OpLShiftNum = 182

§

OpRShiftNum = 183

§

OpNop9 = 184

§

OpNop10 = 185

§

OpNop11 = 186

§

OpNop12 = 187

§

OpNop13 = 188

§

OpNop14 = 189

§

OpNop15 = 190

§

OpNop16 = 191

§

OpNop17 = 192

§

OpNop18 = 193

§

OpNop19 = 194

§

OpNop20 = 195

§

OpNop21 = 196

§

OpNop22 = 197

§

OpNop23 = 198

§

OpNop24 = 199

§

OpNop25 = 200

§

OpNop26 = 201

§

OpNop27 = 202

§

OpNop28 = 203

§

OpNop29 = 204

§

OpNop30 = 205

§

OpNop31 = 206

§

OpNop32 = 207

§

OpNop33 = 208

§

OpNop34 = 209

§

OpNop35 = 210

§

OpNop36 = 211

§

OpNop37 = 212

§

OpNop38 = 213

§

OpNop39 = 214

§

OpNop40 = 215

§

OpNop41 = 216

§

OpNop42 = 217

§

OpNop43 = 218

§

OpNop44 = 219

§

OpNop45 = 220

§

OpNop46 = 221

§

OpNop47 = 222

§

OpNop48 = 223

§

OpNop49 = 224

§

OpNop50 = 225

§

OpNop51 = 226

§

OpNop52 = 227

§

OpNop53 = 228

§

OpNop54 = 229

§

OpNop55 = 230

§

OpNop56 = 231

§

OpNop57 = 232

§

OpNop58 = 233

§

OpNop59 = 234

§

OpNop60 = 235

§

OpNop61 = 236

§

OpNop62 = 237

§

OpNop63 = 238

§

OpNop64 = 239

§

OpNop65 = 240

§

OpNop66 = 241

§

OpNop67 = 242

§

OpNop68 = 243

§

OpNop69 = 244

§

OpNop70 = 245

§

OpNop71 = 246

§

OpNop72 = 247

§

OpNop73 = 248

§

OpSmallData = 249

§

OpSmallInteger = 250

§

OpPubKeys = 251

§

OpNop77 = 252

§

OpPubKeyHash = 253

§

OpPubKey = 254

§

OpInvalidOpcode = 255

Implementations§

Source§

impl Op

Source

pub fn to_name(&self) -> &'static str

Return the canonical name string, e.g. “OP_DUP”, “OP_CHECKSIG”.

Source

pub fn to_byte(&self) -> u8

Return the raw byte value of this opcode.

Source

pub fn from_name(name: &str) -> Option<Op>

Look up an Op by its canonical name string (e.g. “OP_DUP”). Returns None if not found. Also handles aliases like “OP_FALSE” and “OP_TRUE”.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<u8> for Op

Source§

fn from(byte: u8) -> Self

Converts to this type from the input type.
Source§

impl Hash for Op

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Op

Source§

fn eq(&self, other: &Op) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Op

Source§

impl Eq for Op

Source§

impl StructuralPartialEq for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.