• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions
CryptVolt News
  • Home
  • Cryptocurrency
  • Bitcoin
  • Mining
  • Ethereum
  • Litecoin
  • NFT
  • Blockchain
  • Contact Us
No Result
View All Result
  • Home
  • Cryptocurrency
  • Bitcoin
  • Mining
  • Ethereum
  • Litecoin
  • NFT
  • Blockchain
  • Contact Us
No Result
View All Result
CryptVolt News
No Result
View All Result
Home Bitcoin

bitcoin core – What number of sigops are within the invalid block 783426?

reddnbre by reddnbre
April 5, 2023
in Bitcoin
0
mining principle – Multiplanetory Bitcoin
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I used to be in a position to do a partial rely, however I am having a difficult time counting it for P2SH and SegWit transactions.

Parse the block and retailer consequence:

bitcoin-cli getblock 00000000000000000002ec935e245f8ae70fc68cc828f05bf4cfa002668599e4 2 > block.json

This lists transactions like so:

    {
      "txid": "914b24cf50f4bc930c3a11123411031010f010563ed293f65f1ef8cb9bc1e950",
      ...
      "vin": [
        {
          "txid": "cf3349976fedfe34502333310f753d91c16dccb3220d37d5f4c1a11b70eceda2",
          "vout": 1,
          "scriptSig": {
            "asm": "30440220253e9a3fc9cbae7833abc38ea29ae4f7672cb33591c227446c71b26a8199760a022071042cde824b3cfddc51888d49ac8f85062921e1430ee85885252e1a6758fc17[ALL] 02b704c5bac9ed2e23193f28f0a9e1108ff6164e713552fca936c9447566df1d66",
            "hex": "..."
          },
          "series": 4294967295
        }
      ],
      "vout": [
        {
          "value": 0.00071520,
          "n": 1,
          "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 8342c5f824ae0806236e746b951e68192c1b124f OP_EQUALVERIFY OP_CHECKSIG",

            "address": "1Cy3Wd2pArq359z9d3VYMUoBQBM1kkANCn",
            "type": "pubkeyhash"
          }
        }
      ]

I will be able to use jq, grep, sed, awkandwc -l` to rely more than a few stuff.

Legacy OP_CHECKSIG:

cat block.json | jq -r '.tx[].vout[].scriptPubKey.asm' | grep OP_CHECKSIG | wc -l
830

Each and every OP_CHECKSIG used to rely as 1 sigop sooner than SegWit, and now counts as 4.

This yields 830 * 4 = 3,320 sigops

Naked multisig:

cat block.json | jq -r '.tx[].vout[].scriptPubKey.asm' | grep OP_CHECKMULTISIG | wc -l
890

Each and every OP_CHECKMULTISIG counted as 20 sigops sooner than SegWit, without reference to the collection of public keys.

This yields 890 * 20 * 4 = 71,200 sigops.

P2SH:

Now it will get just a little extra difficult. Since the P2SH script is best published while you spend it, we need to have a look at scriptSig at the inputs. In particular we are on the lookout for a scriptSig that is no longer any such:

  1. A standard OP_CHECKSIG spend, which all the time begins with a DER encoded signature (^304.*[.*) and ends with a pubkey (0.*$).
  2. P2SH wrapped v0 SegWit: ^0014.*

We also assume it contains at least one signature, which we recognise by the presence of a sighash marker like [ALL]. The script itself is the very last thing driven at the stack, which is what the awk command offers us. We then pipe that into decodescript.

cat block.json | jq -r '.tx[].vin[].scriptSig.asm'| grep . | grep -v "^304.*[.* 0.*$" | grep -v "^0014.*" | grep "[" | awk 'NF>1{print $NF}' | xargs -i -n 1 bitcoin-cli decodescript {} | jq '.asm'

The result is a very short list consisting of 13 2-of-3 multisig transactions and 1 OP_CHECKSIG.

So that yields (13 * 3 + 1) * 4 = 160 sigops

Pay to witness public key hash:

For this we look at the txinwitness field. Specifically we check if the last stack entry is a public key.

cat block.json | jq -r '.tx[].vin[].txinwitness[-1]' | grep . | grep -v null | grep "^0..*" | wc -l
3981

This yields 3,981 sigops.

Pay to witness script hash:

We once more have a look at the final thing at the witness stack, which we suppose to be the script. We do the other of P2WPK and drop all fits with a public key. We additionally drop (taproot) Schnorr signatures that are 64 bytes plus optionally 1 for the SIGHASH. We additionally drop entries that get started with 33 bytes (I believe those are Tapleaf script hashes).

cat block.json | jq -r '.tx[].vin[].txinwitness[-1]' | grep . | grep -v null | grep -v "^0..*" | sed -r '/^.{128,130}$/d' | sed -r '/^.{66}$/d' | xargs -i -n 1 bitcoin-cli decodescript {} | jq '.asm' | grep -o "OP_CHECKSIG" | wc -l
231

This yields 231 sigops.

We rely multisig similarly. First we kind them by way of N and no longer which N’s are used:

| jq -r '.tx[].vin[].txinwitness[-1]' | grep . | grep -v null | grep -v "^03.*" | sed -r '/^.{128,130}$/d' | sed -r '/^.{66}$/d' | xargs -i -n 1 bitcoin-cli decodescript {} | jq '.asm' | grep "OP_CHECKMULTISIG" | rev | kind | rev

Then rely the collection of occurrences:

  • 2 instances m-of-7: 2 * 7 = 14 sigops
  • 1 time m-of-4: 4 sigops
  • 102 instances m-of-3: 306 sigops
  • 385 instances m-of-2: 770 sigops
  • 27 instances 1-of-1: 27 sigops

In order that yields 1,159 sigops.

General

3320 + 71200 + 160 + 3981 + 231 + 1159 = 80,051



Source_link

Related articles

Bitcoin in IRA: A Robust Funding Technique for Retirement

Bitcoin in IRA: A Robust Funding Technique for Retirement

June 6, 2023
pockets.dat – Getting bitcoin from previous 0.3.0 pockets

Which exchanges or wallets be offering the strategy to open Lightning channels with them on the time of writing?

June 5, 2023
Share76Tweet47

Related Posts

Bitcoin in IRA: A Robust Funding Technique for Retirement

Bitcoin in IRA: A Robust Funding Technique for Retirement

by reddnbre
June 6, 2023
0

As the arena of finance evolves, new and cutting edge monetary tools are making their method into funding portfolios. One...

pockets.dat – Getting bitcoin from previous 0.3.0 pockets

Which exchanges or wallets be offering the strategy to open Lightning channels with them on the time of writing?

by reddnbre
June 5, 2023
0

This can be a draft resolution. As at all times choice solutions are welcome. River is promoting the strategy to...

Binance Regulatory Woes: Richard Teng Eyed As Conceivable Successor To CZ

Binance Regulatory Woes: Richard Teng Eyed As Conceivable Successor To CZ

by reddnbre
June 5, 2023
0

Richard Teng, a former civil servant now within the capability of a distinguished crypto government, is rising as a possible...

Constancy Investments Has Opened Bitcoin Buying and selling To The Public All through Ongoing Banking Disaster

3 Causes At the back of Bitcoin's 2023 Resurgence

by reddnbre
June 4, 2023
0

That is an opinion editorial via Chen Fang, the COO of BitGO, a Bitcoin-focused regulated custody and fiscal services and...

Hang Tight! TMS Community (TMSN) Provides Height Pleasure VS. Monero (XMR) And Cosmos (ATOM)

Hang Tight! TMS Community (TMSN) Provides Height Pleasure VS. Monero (XMR) And Cosmos (ATOM)

by reddnbre
June 4, 2023
0

Crypto fanatics are in most cases in it for the beneficial properties. In case you ended up making an investment...

Load More
  • Trending
  • Comments
  • Latest
How you can Host a Storj Node – Setup, Profits & Stories

How you can Host a Storj Node – Setup, Profits & Stories

June 3, 2022
Ecu alternate Bitvavo hyperlinks with Mercury Redstone to permit simple get right of entry to to crypto indices » CryptoNinjas

Ecu alternate Bitvavo hyperlinks with Mercury Redstone to permit simple get right of entry to to crypto indices » CryptoNinjas

June 2, 2022
What is the Easiest Blockchain IoT Ability Trail For Me?

What is the Easiest Blockchain IoT Ability Trail For Me?

June 5, 2022
Ethereum Mining in 2021

Ethereum Mining in 2021

May 9, 2022
Immortalize Your Devoted Animal Partners with the Petaverse

Immortalize Your Devoted Animal Partners with the Petaverse

0
April – Paintings Growth File

April – Paintings Growth File

0

2021’s Virtual Asset Shuffle: A Myriad of Crypto Marketplace Cap Positions Moved Chaotically This 12 months

0
Luna Basis Acquires An Further 37.8k Bitcoin Value $1.5B, Bringing its Overall Holdings to 80,394 BTC

Luna Basis Acquires An Further 37.8k Bitcoin Value $1.5B, Bringing its Overall Holdings to 80,394 BTC

0
OKX and Komainu to Spice up Institutional Crypto Buying and selling

OKX and Komainu to Spice up Institutional Crypto Buying and selling

June 6, 2023
Devcon On-Chain Raffle & Public sale Individuals

Devcon On-Chain Raffle & Public sale Individuals

June 6, 2023
Bitcoin in IRA: A Robust Funding Technique for Retirement

Bitcoin in IRA: A Robust Funding Technique for Retirement

June 6, 2023
DeFi Llama: A Skilled Analytics Dashboard

DeFi Llama: A Skilled Analytics Dashboard

June 5, 2023

CryptVolt News

Welcome to cryptvoltnews The goal of cryptvoltnews is to give you the absolute best news sources for any topic! Our topics are carefully curated and constantly updated as we know the web moves fast so we try to as well.

Categories tes

  • Bitcoin
  • Blockchain
  • Cryptocurrency
  • Ethereum
  • Litecoin
  • Mining
  • NFT

Recent Posts

  • OKX and Komainu to Spice up Institutional Crypto Buying and selling
  • Devcon On-Chain Raffle & Public sale Individuals

Recent Comments

    • Home
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms & Conditions

    © 2017 JNews - Crafted with love by Jegtheme.

    No Result
    View All Result
    • Home
    • Cryptocurrency
    • Bitcoin
    • Mining
    • Ethereum
    • Litecoin
    • NFT
    • Blockchain
    • Contact Us

    © 2018 JNews by Jegtheme.

    What Are Cookies
    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
    Cookie SettingsAccept All
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    SAVE & ACCEPT