mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-25 18:21:36 +08:00
remove sender_scriptpubkey and sender_pubkey from BurnchainTxInput -- we won't be needing them
This commit is contained in:
@@ -56,82 +56,6 @@ pub fn parse_script<'a>(script: &'a Script) -> Vec<Instruction<'a>> {
|
||||
|
||||
impl BurnchainTxInput<BitcoinPublicKey> {
|
||||
|
||||
/// recover the sender scriptpubkey from its public key in the script sig
|
||||
fn sender_scriptpubkey_p2pkh(pubk: &BitcoinPublicKey) -> Vec<u8> {
|
||||
let key_hash = Hash160::from_data(&pubk.to_bytes());
|
||||
|
||||
let mut res : Vec<u8> = Vec::with_capacity(3 + 20 + 2);
|
||||
res.extend_from_slice(&[0x76, 0xa9, 0x14]);
|
||||
res.extend_from_slice(key_hash.as_bytes());
|
||||
res.extend_from_slice(&[0x88, 0xac]);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// recover the sender scriptpubkey from its p2sh multisig redeem script
|
||||
fn sender_scriptpubkey_p2sh_multisig(num_sigs: usize, pubkeys: &Vec<BitcoinPublicKey>) -> Vec<u8> {
|
||||
let mut bldr = Builder::new();
|
||||
bldr = bldr.push_int(num_sigs as i64);
|
||||
for pubk in pubkeys {
|
||||
bldr = bldr.push_slice(&pubk.to_bytes());
|
||||
}
|
||||
bldr = bldr.push_int(pubkeys.len() as i64);
|
||||
bldr = bldr.push_opcode(btc_opcodes::OP_CHECKMULTISIG);
|
||||
|
||||
let script = bldr.into_script();
|
||||
let script_hash = Hash160::from_data(&script.as_bytes());
|
||||
|
||||
let mut res: Vec<u8> = Vec::with_capacity(2 + 20 + 1);
|
||||
res.extend_from_slice(&[0xa9, 0x14]);
|
||||
res.extend_from_slice(script_hash.as_bytes());
|
||||
res.extend_from_slice(&[0x87]);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/// recover the sender scriptpubkey from its p2wpkh-p2sh redeem script
|
||||
fn sender_scriptpubkey_p2wpkh_p2sh(pubk: &BitcoinPublicKey) -> Vec<u8> {
|
||||
let key_hash = Hash160::from_data(&pubk.to_bytes());
|
||||
|
||||
let bldr = Builder::new()
|
||||
.push_int(0)
|
||||
.push_slice(key_hash.as_bytes());
|
||||
|
||||
let script = bldr.into_script();
|
||||
let script_hash = Hash160::from_data(&script.as_bytes());
|
||||
|
||||
let mut res: Vec<u8> = Vec::with_capacity(2 + 20 + 1);
|
||||
res.extend_from_slice(&[0xa9, 0x14]);
|
||||
res.extend_from_slice(script_hash.as_bytes());
|
||||
res.extend_from_slice(&[0x87]);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// recover the sender scriptpubkey from its p2wsh-p2sh redeem script
|
||||
fn sender_scriptpubkey_p2wsh_p2sh_multisig(num_sigs: usize, pubkeys: &Vec<BitcoinPublicKey>) -> Vec<u8> {
|
||||
let mut bldr = Builder::new();
|
||||
bldr = bldr.push_int(num_sigs as i64);
|
||||
for pubk in pubkeys {
|
||||
bldr = bldr.push_slice(&pubk.to_bytes());
|
||||
}
|
||||
bldr = bldr.push_int(pubkeys.len() as i64);
|
||||
bldr = bldr.push_opcode(btc_opcodes::OP_CHECKMULTISIG);
|
||||
|
||||
let mut digest = Sha256::new();
|
||||
let mut d = [0u8; 32];
|
||||
|
||||
digest.input(bldr.into_script().as_bytes());
|
||||
digest.result(&mut d);
|
||||
|
||||
let ws = Builder::new().push_int(0).push_slice(&d).into_script();
|
||||
let ws_hash = Hash160::from_data(&ws.as_bytes());
|
||||
|
||||
let mut res: Vec<u8> = Vec::with_capacity(2 + 20 + 1);
|
||||
res.extend_from_slice(&[0xa9, 0x14]);
|
||||
res.extend_from_slice(ws_hash.as_bytes());
|
||||
res.extend_from_slice(&[0x87]);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Parse a script instruction stream encoding a p2pkh scritpsig into a BurnchainTxInput
|
||||
pub fn from_bitcoin_p2pkh_script_sig(instructions: &Vec<Instruction>) -> Option<BurnchainTxInput<BitcoinPublicKey>> {
|
||||
if instructions.len() != 2 {
|
||||
@@ -150,8 +74,6 @@ impl BurnchainTxInput<BitcoinPublicKey> {
|
||||
Some(BurnchainTxInput {
|
||||
keys: vec![pubkey],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(pubkey),
|
||||
sender_scriptpubkey: BurnchainTxInput::sender_scriptpubkey_p2pkh(&pubkey)
|
||||
})
|
||||
}
|
||||
Err(_e) => {
|
||||
@@ -169,8 +91,7 @@ impl BurnchainTxInput<BitcoinPublicKey> {
|
||||
|
||||
/// given the number of sigs required (m) and an array of pubkey pushbytes instructions, extract
|
||||
/// a burnchain tx input. If segwit is True, then it means these pushbytes came from a witness
|
||||
/// program instead of a script-sig (this affects how the sender_scriptpubkey will be filled
|
||||
/// in).
|
||||
/// program instead of a script-sig
|
||||
fn from_bitcoin_pubkey_pushbytes(num_sigs: usize, pubkey_pushbytes: &[Instruction], segwit: bool) -> Option<BurnchainTxInput<BitcoinPublicKey>> {
|
||||
if num_sigs < 1 || pubkey_pushbytes.len() < 1 || pubkey_pushbytes.len() < num_sigs {
|
||||
test_debug!("Not a multisig script: num_sigs = {}, num_pubkeys <= {}", num_sigs, pubkey_pushbytes.len());
|
||||
@@ -205,19 +126,9 @@ impl BurnchainTxInput<BitcoinPublicKey> {
|
||||
keys.push(pubk.unwrap());
|
||||
}
|
||||
|
||||
let sender_scriptpubkey =
|
||||
if segwit {
|
||||
BurnchainTxInput::sender_scriptpubkey_p2wsh_p2sh_multisig(num_sigs, &keys)
|
||||
}
|
||||
else {
|
||||
BurnchainTxInput::sender_scriptpubkey_p2sh_multisig(num_sigs, &keys)
|
||||
};
|
||||
|
||||
Some(BurnchainTxInput::<BitcoinPublicKey> {
|
||||
keys: keys,
|
||||
num_required: num_sigs,
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: sender_scriptpubkey
|
||||
})
|
||||
}
|
||||
|
||||
@@ -246,22 +157,10 @@ impl BurnchainTxInput<BitcoinPublicKey> {
|
||||
}
|
||||
|
||||
let num_keys = keys.len();
|
||||
let sender_scriptpubkey =
|
||||
if num_keys == 1 {
|
||||
// p2wpkh-p2sh
|
||||
BurnchainTxInput::sender_scriptpubkey_p2wpkh_p2sh(&keys[0])
|
||||
}
|
||||
else {
|
||||
// p2wsh-p2sh
|
||||
BurnchainTxInput::sender_scriptpubkey_p2wsh_p2sh_multisig(num_sigs, &keys)
|
||||
};
|
||||
|
||||
|
||||
let tx_input = BurnchainTxInput::<BitcoinPublicKey> {
|
||||
keys: keys,
|
||||
num_required: num_sigs,
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: sender_scriptpubkey
|
||||
};
|
||||
|
||||
|
||||
@@ -501,33 +400,6 @@ impl BurnchainTxInput<BitcoinPublicKey> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the address from the sender scriptpubkey
|
||||
/// Returns None if the sender_scriptpubkey does not encode a p2pkh or p2sh script
|
||||
pub fn address(&self, network_id: BitcoinNetworkType) -> Option<BitcoinAddress> {
|
||||
// p2pkh?
|
||||
if self.sender_scriptpubkey.len() == 25 &&
|
||||
self.sender_scriptpubkey[0..3] == [0x76, 0xa9, 0x14] &&
|
||||
self.sender_scriptpubkey[23..25] == [0x88, 0xac] {
|
||||
|
||||
let addrbits = self.sender_scriptpubkey[3..23].to_vec();
|
||||
let addr = BitcoinAddress::from_bytes(network_id, BitcoinAddressType::PublicKeyHash, &addrbits).unwrap(); // NOTE: should always succeed
|
||||
return Some(addr);
|
||||
}
|
||||
// p2sh?
|
||||
else if self.sender_scriptpubkey.len() == 23 &&
|
||||
self.sender_scriptpubkey[0..2] == [0xa9, 0x14] &&
|
||||
self.sender_scriptpubkey[22] == 0x87 {
|
||||
|
||||
let addrbits = self.sender_scriptpubkey[2..22].to_vec();
|
||||
let addr = BitcoinAddress::from_bytes(network_id, BitcoinAddressType::ScriptHash, &addrbits).unwrap(); // NOTE: should always succeed
|
||||
return Some(addr);
|
||||
}
|
||||
// unrecognized
|
||||
else {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl BurnchainTxOutput<BitcoinAddress> {
|
||||
@@ -611,8 +483,6 @@ mod tests {
|
||||
keys: vec![
|
||||
BitcoinPublicKey::from_hex("032cb957290adc734c56dbc29b63f94f1c493cd895aaa628766861b3d195dd1043").unwrap()
|
||||
],
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("032cb957290adc734c56dbc29b63f94f1c493cd895aaa628766861b3d195dd1043").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a91483db6587adb96669cfb3fcb2d680a09aba6250cd88ac").unwrap().to_vec()
|
||||
}
|
||||
},
|
||||
ScriptFixture {
|
||||
@@ -623,8 +493,6 @@ mod tests {
|
||||
keys: vec![
|
||||
BitcoinPublicKey::from_hex("040fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc806b9a4f07579934774cc0c155e781d45c989f94336765e88a66d91cfb9f060b0").unwrap()
|
||||
],
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("040fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc806b9a4f07579934774cc0c155e781d45c989f94336765e88a66d91cfb9f060b0").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a914395f3643cea07ec4eec73b4d9a973dcce56b9bf188ac").unwrap().to_vec()
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -657,8 +525,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("04019ef04a316792f0ecbe5ab1718c833c3964dee3626cfabe19d97745dbcaa5198919081b456e8eeea5898afa0e36d5c17ab693a80d728721128ed8c5f38cdba0").unwrap(),
|
||||
BitcoinPublicKey::from_hex("04a04f29f308160e6f945b33d943304b1b471ed8f9eaceeb5412c04e60a0fab0376871d9d1108948b67cafbc703e565a18f8351fb8558fd7c7482d7027eecd687c").unwrap()
|
||||
],
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a9144b86dfac7f503de1127366815d1d45241328246687").unwrap().to_vec()
|
||||
}
|
||||
},
|
||||
ScriptFixture {
|
||||
@@ -683,8 +549,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71").unwrap(),
|
||||
BitcoinPublicKey::from_hex("0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71").unwrap()
|
||||
],
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a9142c2edf39b098e05cf770e6b5a2fcedb54ee4fe0587").unwrap().to_vec()
|
||||
}
|
||||
},
|
||||
ScriptFixture {
|
||||
@@ -697,8 +561,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("0243930746e6ed6552e03359db521b088134652905bd2d1541fa9124303a41e956").unwrap(),
|
||||
BitcoinPublicKey::from_hex("029e03a901b85534ff1e92c43c74431f7ce72046060fcf7a95c37e148f78c77255").unwrap()
|
||||
],
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a9149af61346ce0aa2dffcf697352b4b704c84dcbaff87").unwrap().to_vec()
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -735,8 +597,6 @@ mod tests {
|
||||
keys: vec![
|
||||
BitcoinPublicKey::from_hex("02d341f728783eb93e6fb5921a1ebe9d149e941de31e403cd69afa2f0f1e698e81").unwrap()
|
||||
],
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a91431f8968eb1730c83fb58409a9a560a0a0835027f87").unwrap().to_vec()
|
||||
})
|
||||
},
|
||||
ScriptWitnessFixture {
|
||||
@@ -812,8 +672,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("02f21b29694df4c2188bee97103d10d017d1865fb40528f25589af9db6e0786b65").unwrap(),
|
||||
BitcoinPublicKey::from_hex("028791dc45c049107fb99e673265a38a096536aacdf78aa90710a32fff7750f9f9").unwrap()
|
||||
],
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a91487a0487869af70b6b1cc79bd374b75ba1be5cff987").unwrap().to_vec()
|
||||
})
|
||||
},
|
||||
ScriptWitnessFixture {
|
||||
|
||||
@@ -518,24 +518,18 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("040fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc806b9a4f07579934774cc0c155e781d45c989f94336765e88a66d91cfb9f060b0").unwrap(),
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("040fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc806b9a4f07579934774cc0c155e781d45c989f94336765e88a66d91cfb9f060b0").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a914395f3643cea07ec4eec73b4d9a973dcce56b9bf188ac").unwrap().to_vec()
|
||||
},
|
||||
BurnchainTxInput {
|
||||
keys: vec![
|
||||
BitcoinPublicKey::from_hex("040fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc806b9a4f07579934774cc0c155e781d45c989f94336765e88a66d91cfb9f060b0").unwrap(),
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("040fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc806b9a4f07579934774cc0c155e781d45c989f94336765e88a66d91cfb9f060b0").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a914395f3643cea07ec4eec73b4d9a973dcce56b9bf188ac").unwrap().to_vec()
|
||||
},
|
||||
BurnchainTxInput {
|
||||
keys: vec![
|
||||
BitcoinPublicKey::from_hex("04c77f262dda02580d65c9069a8a34c56bd77325bba4110b693b90216f5a3edc0bebc8ce28d61aa86b414aa91ecb29823b11aeed06098fcd97fee4bc73d54b1e96").unwrap(),
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("04c77f262dda02580d65c9069a8a34c56bd77325bba4110b693b90216f5a3edc0bebc8ce28d61aa86b414aa91ecb29823b11aeed06098fcd97fee4bc73d54b1e96").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a9149f2660e75380675206b6f1e2b4f106ae33266be488ac").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -566,8 +560,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("046fd8c7330fbe307a0fad0bf9472ca080f4941f4b6edea7ab090e3e26075e7277a0bd61f42eff54daf3e6141de46a98a5a8265c9e8d58bd1a86cf36d418788ab8").unwrap(),
|
||||
],
|
||||
num_required: 2,
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a914eb1881fb0682c2eb37e478bf918525a2c61bc40487").unwrap().to_vec()
|
||||
},
|
||||
BurnchainTxInput {
|
||||
keys: vec![
|
||||
@@ -576,8 +568,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("044c9f30b4546c1f30087001fa6450e52c645bd49e91a18c9c16965b72f5153f0e4b04712218b42b2bc578017b471beaa7d8c0a9eb69174ad50714d7ef4117863d").unwrap(),
|
||||
],
|
||||
num_required: 2,
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a914c26afc6cb80ca477c280780902b40cbef8cd804d87").unwrap().to_vec()
|
||||
},
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -606,8 +596,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("02d341f728783eb93e6fb5921a1ebe9d149e941de31e403cd69afa2f0f1e698e81").unwrap()
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a91431f8968eb1730c83fb58409a9a560a0a0835027f87").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -638,8 +626,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("028791dc45c049107fb99e673265a38a096536aacdf78aa90710a32fff7750f9f9").unwrap()
|
||||
],
|
||||
num_required: 2,
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a91487a0487869af70b6b1cc79bd374b75ba1be5cff987").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -714,8 +700,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("02d341f728783eb93e6fb5921a1ebe9d149e941de31e403cd69afa2f0f1e698e81").unwrap()
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: None,
|
||||
sender_scriptpubkey: hex_bytes("a91431f8968eb1730c83fb58409a9a560a0a0835027f87").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -753,8 +737,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("03d6fd1ba0effaf1e8d94ea7b7a3d0ef26fea00a14ce5ffcc1495fe588a2c6d0f3").unwrap()
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("03d6fd1ba0effaf1e8d94ea7b7a3d0ef26fea00a14ce5ffcc1495fe588a2c6d0f3").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a91474178497e927ff3ff1428a241be454d393c3c91c88ac").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -780,8 +762,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("04ef29f16c10aa2d0468d7841cfedb8b5729689ebca4db38fb8f3fc9ab158e799b6d6dfc2bca52fe490f7acd38e351bf1d28b8f1f48736a0b022f806dd107a8385").unwrap()
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("04ef29f16c10aa2d0468d7841cfedb8b5729689ebca4db38fb8f3fc9ab158e799b6d6dfc2bca52fe490f7acd38e351bf1d28b8f1f48736a0b022f806dd107a8385").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a91441a349571d89decfac52ffecd92300b6a97b284188ac").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -807,8 +787,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("0479ff722ee4dfd880e307d06fc50a248a9f73a57998a65fd95c48436400280372cf9e99a9952ded7723a68118d4dcf658efbaed2a73265fc63b44789d2d459637").unwrap()
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("0479ff722ee4dfd880e307d06fc50a248a9f73a57998a65fd95c48436400280372cf9e99a9952ded7723a68118d4dcf658efbaed2a73265fc63b44789d2d459637").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a914e1762290e3f035ea4e7f8cbf72a9d9386c4020ab88ac").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -834,8 +812,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("04447019ded953edd1bcecffbc66a555f822675257bacc0d357c1dc5194849367354c551e2c2e2048cb927985c8528e24120addd9aa0a2c68b23b462f337caaebc").unwrap()
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("04447019ded953edd1bcecffbc66a555f822675257bacc0d357c1dc5194849367354c551e2c2e2048cb927985c8528e24120addd9aa0a2c68b23b462f337caaebc").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a914f3c49407d41b82f30636f5180718bb658ce7fe9488ac").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
@@ -861,8 +837,6 @@ mod tests {
|
||||
BitcoinPublicKey::from_hex("04a96a8355b6c3597bb9425c2ef264ab8179ca8acd3032b62980d2067261b37666b66510983e6d60d49bbd28129f0bae4dbcaa97c2bc61a6b2e48ca1625ce81335").unwrap()
|
||||
],
|
||||
num_required: 1,
|
||||
sender_pubkey: Some(BitcoinPublicKey::from_hex("04a96a8355b6c3597bb9425c2ef264ab8179ca8acd3032b62980d2067261b37666b66510983e6d60d49bbd28129f0bae4dbcaa97c2bc61a6b2e48ca1625ce81335").unwrap()),
|
||||
sender_scriptpubkey: hex_bytes("76a914afc75a8f8fbcb922248a663dec927b33dccaed3788ac").unwrap().to_vec()
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
|
||||
@@ -86,10 +86,6 @@ pub struct BurnchainTxOutput<A: Address> {
|
||||
pub struct BurnchainTxInput<K: PublicKey> {
|
||||
pub keys: Vec<K>,
|
||||
pub num_required: usize,
|
||||
|
||||
// TODO: these can be removed if we're never going to use them
|
||||
pub sender_scriptpubkey: Vec<u8>, // LEGACY: required for consensus in Bitcoin for some operations -- this is the sender's deduced scriptpubkey (derived from the transaction scriptsig)
|
||||
pub sender_pubkey: Option<K> // LEGACY: required for consensus in Bitcoin for some operations -- this is the sender's public key extracted from the scriptsig (but only if this spends a p2pkh)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user