Why are some transactions larger (in bytes) than others?


Assuming all the inputs you are spending are from regular "pay to address" transactions, each input will contribute 180 (plus or minus 1) bytes to the transaction. Each output adds 34 bytes to the transaction. And there's a fixed extra 10 bytes which are always present.

The "plus or minus 1" comes from the fact that each input needs a signature to be claimed. The signature contains two 32 byte values, but if either of the values has a first byte of 0x80 or more, it has a 0x00 byte prepended to it. So I'm assuming one of the two is high and the other is low. That way I'm off by at most one byte per input.

So if your transaction has in inputs and out outputs, the transaction size, in bytes will be:

in*180 + out*34 + 10 plus or minus 'in'

For example, this transaction has 40 inputs and 16 outputs. That gives us a transaction size of

40*180 + 16*34 + 10 +- 40

i.e. 7754 +- 40 bytes. The actual size is 7761 bytes.

If the inputs are from "pay to pubkey"...

0 0

Transaction outputs have a "value" field that's an 8-byte signed integer (always 8 bytes) indicating how many satoshis (0.00000001 BTC each) are available for that output. That is the thing that gets set to -1 on the other outputs in SIGHASH_SINGLE mode.

This looks to be the code responsible for making this happen, from script.cpp:

/** Serialize an output of txTo */ template void SerializeOutput(S &s, unsigned int nOutput, int nType, int nVersion) const { if (fHashSingle && nOutput != nIn) // Do not lock-in the txout payee at other indices as txin ::Serialize(s, CTxOut(), nType, nVersion); else ::Serialize(s, txTo.vout[nOutput], nType, nVersion); }

If we're in SIGHASH_SINGLE mode, and the index of the output is different from the index of the input, then the thing that we sign in this spot is just a dummy CTxOut object, whose parameterless constructor (in core.h) calls SetNull(), which sets the field called "nValue" to -1 (-0.00000001 BTC) and clears...

0 0

It would seem using a large Tx fee is an attack vector in that miners will all realign to try and solve the block at height n, which is quite different to the normal situation where it's usually two chains competing for length. The outcome requires 100% "rational actors" trying to mine the block height n and the ability of the nodes to detect the errantly/anomalously high fee.

The freeze problem occurs if someone publishes a transaction with fees much higher than the block subsidy. I don’t remember who described the attack first. Suppose that, by mistake, a transaction is published with 50 BTC in fees. The transaction is included in a block at height n. If everyone acts rationally in his own interest, then the best choice for the remaining miners is to try to mine a competing block at the same height n including the high-fee transaction, to collect the fee for themselves. All the miners having solved the block at height n, now move on mining at height (n+1). But they...

0 0

Each node on the network has its own mempool. While they are filled with similar transactions, each may have a different size limit or perhaps even custom rules which transactions to retain.

In this particular case you can see (figure 1) that there is a (U) shown in both inputs of the transaction. The (U) means that the inputs are created by a transaction that is still unconfirmed.

In fact, when you look at the address that the two inputs were spent to before (figure 2), you'll see that both were created in transactions that only paid 4.4 satoshis per byte whereas the transaction you linked pays 65 satoshis per byte.

I would surmise that the first two transactions that created the inputs might have not been relayed to or were not kept in the mempool of the other blockexplorers. Then, the transaction that you linked would seem invalid to those blockexplorers, because the referenced inputs are not known to it.

You may find this related...

0 0

This is not a definitive answer, but it may shed some light on the causes of a TransactionTooLargeException and help pinpoint the problem.

Although most answers refer to large amounts of data transferred, I see this exception being thrown incidentally after heavy scrolling and zooming and repeatedly opening an ActionBar spinner menu. The crash happens on tapping the action bar. (this is a custom mapping app)

The only data being passed around seem to be touches from the "Input Dispatcher" to the app. I think this cannot reasonably amount to anywhere near 1 mb in the "Transaction Buffer".

My app is running on a quad core 1.6 GHz device and uses 3 threads for heavylifting, keeping one core free for the UI thread. Furthermore, the app uses android:largeHeap, has 10 mb of unused heap left and has 100 mb of room left to grow the heap. So I wouldn't say it is a resource issue.

The crash is always immediately preceded by these lines:

0 0

If you are interested in how characters are stored, you can go to www.unicode.org and look around. At the top of their main page is a link "Code Charts" that shows you all the character codes that are available in Unicode.

All in all, there are a bit over one million codes available in Unicode (not all of them are used). One byte can hold 256 different values, so you would need three bytes if you wanted to store every possible Unicode code.

Instead, Unicode is usually stored in the "UTF-8" encoding which uses fewer bytes for some characters and more for others. The first 128 code values are stored in a single byte, up to the first 2048 code values are stored in two bytes, up to 65536 are stored in three bytes, and the rest take four bytes. This has been arranged so that code values that are used more often take less space. A-Z, a-z, 0-9 and !@$%^&*()-[}{};':"|,./? and some that I forgot take one byte; almost all of English, 98% of German and French (just guessing) can...

0 0
It is longstanding practice because it removes a lot of variables that are unknown or variable:

How many bits are in a byte? If you answer eight without any qualification I'll point out that it isn't on all systems.

What is the framing overhead? Many systems send 10 bits of traffic to send 8 bits of useful data.

What about bit stuffing? This is additional traffic that needs to be transmitted so the data makes sense at the other end. What makes this one difficult is that the amount of overhead it takes depends on the data that is being sent.

All of these need to be taken into account before you can arrive even at a raw byte figure and take place before any byte level overhead, such as framing, packetisation, segmentation and so on. They themselves are enough to make a bytes per second figure inappropriate and misleading. The common formula you see used here - divide by eight to arrive at a byte figure - is at best naive since it ignores all of these issues and...

0 0

Jonathan McIver

The availability of funds does not always guarantee success, howevermoney often means the size of the company increases, which mayindicate that, as previously mentioned, big companies can hold strongpositions within the running of the country. The trade unions have somuch power, as money is gained through subscriptions from theirmembers. The organisation of pressure groups is often behind the action that isdone to help their cause, for example a high amount of staff, a strongmanagement structure, and a network for recruiting new members.Strong organisation can help achieve the pressure groups aims, theseare big advantages over smaller, less formal and organisedmovements. The countryside alliance in 1998 organised a massivedemonstration in London, proving their preparedness, and amount of organisational skills. The fuel lobby in 2000 is a fine example of logistical organisation. The internet provided a great ally, as through itthe group organised a huge...

0 0

Bitcoin is the currency of the Internet: a distributed, worldwide, decentralized digital money. Unlike traditional currencies such as dollars, bitcoins are issued and managed without any central authority whatsoever: there is no government, company, or bank in charge of Bitcoin. As such, it is more resistant to wild inflation and corrupt banks. With Bitcoin, you can be your own bank.

If you are new to Bitcoin, check out We Use Coins and Bitcoin.org. You can also explore the Bitcoin Wiki:

How to buy bitcoins worldwide
Buying Reddit Gold with bitcoin

Will I earn money by mining bitcoin?

Security guide for beginners - (WIP)

Community guidelines

Do not use URL shortening services: always submit the real link. Begging/asking for bitcoins is absolutely not allowed, no matter how badly you need the bitcoins. Only requests for donations to large, recognized charities are allowed, and only if there is good reason to believe that the person...
0 0

Q: I’m confused by some behavior I’ve noticed with differential backups. When I update a large portion of a table (say, 10GB), the next differential backup is about 10GB. When I perform the same update and then roll back the transaction, the next differential backup is still 10GB. Why isn’t the differential backup empty in the second case?

A: You’re correct that the behavior doesn’t seem intuitive at first—nothing changed in the data, right? However, SQL Server is absolutely doing the right thing under the covers. The explanation of this behavior has two parts.

First, I’ll explain how SQL Server knows what to include in a differential backup. The behavior is the same for file, file groups, and database differential backups (I’ll just call them differential backups for simplicity). A differential backup includes everything that has changed since the last full backup, with the minimum unit of change being an extent (i.e., a 64KB chunk of a data file comprised of 8KB x...

0 0

The law of one price does not seem to hold, so Brandon Berg poses a question to me:

I’m curious about the reasons for the wide regional variation in wages for software engineers. Computer software would seem to be the ultimate tradeable good, as it can be sent instantly around the world at zero cost. I’m a computer programmer and have recently been looking into employment opportunities in East Asia, and was surprised to find that typical wages for programmers varied by as much as a factor of 5, with the US and Japan at the upper extreme and mainland China at the lower extreme. Wages in Singapore are less than half of US wages, despite a similar per-capita GDP. Wages in Shenzhen are less than half of what they are in Hong Kong, just an hour’s train ride away.

What’s going on here? Why do firms continue to hire overpriced American and Japanese software engineers when they can get them for half price in Hong Kong, even less in Singapore and Taiwan, and at a 75-80%...

0 0

If you’re reading this post I assume that like many others, you sent a bitcoin transaction and was kind of confused as to why it’s still listed as “unconfirmed” or “pending” after a few hours or so.

I mean Bitcoin transactions are supposed to be instant right?

In this post I want to try and explain in a very basic way how a Bitcoin transaction works and why the fee that you attach to each transaction has a crucial role in how long it will take the transaction to go through the network.

Here’s what happens when you send Bitcoins to someone

Whenever you send someone Bitcoins, the transaction goes through different computers running the Bitcoin protocol around the world that make sure the transaction is valid. Once the transaction is verified it then “waits” inside the Mempool (i.e. in some sort of a “limbo” state).

It’s basically waiting to be picked up by a Bitcoin miner and entered into a block of transaction on the Blockchain. Until it is picked...

0 0

This happens because the total disk usage is never equal to the sum of all files there (which is what Nautilius shows once you select all files).

The reason for this is that the file systems themselves tend to occupy some space on the partition. Most likely, if you wiped out all data you store on that HDD, disk usage would be about 150GB. That space is reserved for the file system - it is required, as the file system need to store the data about files somewhere. ext4 pre-allocates this overhead space before any files are created, as opposed to - for example - ext3, where that space grows as more files are added to the partition.

If you consider these 150GB as a problem, please notice that it's just 5% of your total HDD size. If you would need more than 95% on you hard drive, you probably need to buy a larger one, instead of worrying about these 150GB that are out of your reach.

Also, please keep in your mind that in case of ext4 this space is not wasted. Data...

0 0


I quite easily get mild electric shocks from things like car doors. Why are some people more susceptible to this than others? Are such people at greater risk of getting struck by lightning?

J.Jefferies, Fareham

This also happens to me. I beleive it is caused by static electricity. Some people seem to carry a higher static charge than others, (well thta's my theory).

Corrina Finnis, Penzance, Cornwall, UK

The answer lies in your shoes. Thick, rubber soled shoes (like trainers) insulate you from the ground and from the metal parts of your car, and so any static electricity you pick up - by rubbing against the car seats, for example - is not dissipated gradually. Instead it is dissipated suddenly when you touch the metal of the car door. You could try one of those earth strips that people hang from the back of their cars to try and prevent car sickness. Attach it to the back of your heel, and you will be earthed whetever you walk (as well as...
0 0

Actually, yes.
Transactions sent on the networks are broadcast across the network instantly. This is why when someone sends you a Bitcoin payment to your Coinbase account, you can see it show up as "pending" right away. Other wallets and some Bitcoin clients can accept these 0 confirmation transactions.

The Coinbase wallet will wait until a transaction has 3 confirmations before marking it as "complete." Other wallets and services will wait for more or less confirmations. There is no arbitrary amount that Bitcoin says you have to follow. But the general rule is: the more confirmations a transaction has, the "safer" it is to accept it. I'm going to go way off on a tangent and get a bit technical, but here's one reason why:


Miners (and probably more specifically, mining pools) are the entities in Bitcoin that submit blocks and confirm the transactions. But what happens if two miners submit a block at the same time? This happens more than you...

0 0

The easy way to save screenshots, GIFs, and websites. Make everyone happy by sharing smarter, faster, and with your point crystal clear.

I mean, I know its probably for artistic sense to display their character, but it seems more of a curse than a blessing with real applications. Can Garen even eat? Does he need special aid to perform more delicate tasks? You can REALLY see it with the new Urgot. The poor man giving him a tattoo needs a LIFT to get UP THERE. it could be more easily explained for URGOT the chemtech juggernaut to have that immense size, but Garen's a normal dude. Is there just a bad plague of gigantism going around? (P.S. i don't actually mind the height change, it's obvious it has a purpose, just poking to make...

0 0

The battle for attention is over. The time for banging drums is long past. Everyone now understands that manufacturing provides an essential source of competitive leverage. No longer does anyone seriously think that domestic producers can outdo their competitors by clever marketing only—“selling the sizzle” while cheating on quality or letting deliveries slip. It is now time for concrete action on a practical level: action to change facilities, update processing technologies, adjust work-force practices, and perfect information and management systems.

But when managers turn to these tasks, they quickly run up against a stumbling block. Namely, they do not have adequate measures for judging factory-level performance or for comparing overall performance from one facility to the next. Of course, they can use the traditional cost-accounting figures, but these figures often do not tell them what they really need to know. Worse, even the best numbers do not sufficiently reflect...

0 0

“My sys admin says that SAN backups make dedicated database or log backups obsolete. Is he right?”

It’s true that many modern SAN-based disaster recovery solutions offer ‘transaction-aware’ database backups. However, as a DBA, I would analyze carefully the Service Level Agreements for all databases in your care, their disaster recovery requirements and maximum tolerable exposure to data loss, and then perform careful test restores with the SAN backups to ensure you can meet all these requirements.

Native SQL Server database backups capture the current state of the database at a specific point in time, plus enough of the transaction log to ensure that, upon restoring the backup, SQL Server can run the recovery process, which guarantees that the database is transactionally-consistent at that specific point in time. Make sure that the SAN Backup offers a similar guarantee; it may render the database ‘quiescent’ temporarily, essentially freezing all I/O prior to taking...

0 0
0 0

Vision is the most important and prioritized sense that we have. We are constantly looking at the world around us, and quickly we identify and make sense of what it is that we see.

Let's just start with an example of that very fact. I'm going to show you
a photograph of a person, just for a second or two, and I'd like for you to identify what emotion is on his face. Ready? Here you go. Go with your gut reaction. Okay. What did you see? Well, we actually surveyed over 120 individuals, and the results were mixed. People did not agree on what emotion they saw on his face. Maybe you saw discomfort. That was the most frequent response that we received. But if you asked the person on your left, they might have said regret or skepticism, and if you asked somebody on your right, they might have said
something entirely different, like hope or empathy. So we are all looking at the very same face again. We might see something entirely different, because...

0 0

NBER Working Paper No. 23548
Issued in June 2017
NBER Program(s): LS

Success, measured by earnings or education, of immigrants in the US varies dramatically by country of origin. For example, average educational attainment among immigrants ranges from 9 to 16 years, depending on origin country. Perhaps surprisingly, immigrants from Algeria have higher educational attainment than those from Israel or Japan. Also true is that there is a strong inverse relation of attainment to number of immigrants from that country. These patterns result because in the US, immigrant slots are rationed. Selection from the top of the origin country’s ability distribution is assumed and modeled. The main implications are that average immigrant attainment is inversely related to the number admitted from a origin country and positively related to the population of that origin country. The results are unequivocally supported by results from the American Community Survey. The...

0 0
Notes on Mishkin Chapter 8 (Econ 353, Tesfatsion)

Notes on Mishkin Chapter 8
("Economic Analysis of Financial Structure")
Econ 353: Money, Banking, and Financial Institutions

Last Updated: 28 March 2015 Latest Course Offering: Spring 2011 Course Instructor: Professor Leigh Tesfatsion
tesfatsi AT iastate.edu
Econ 353 Home Page: http://www2.econ.iastate.edu/classes/econ353/tesfatsion/

Eight Puzzles Concerning Financial Structure Transactions Costs in Relation to Puzzle 3 Asymmetric Information Problems Revisited Adverse Selection in Financial Markets Moral Hazard in Financial Markets Adverse Selection in Relation to Puzzles 1-7 Moral Hazard in Relation to Puzzles 1-5 and 7-8 Conflicts of Interest Basic Concepts and Key Issues for Mishkin Chapter 8

Eight Puzzles Concerning Financial Structure

This section...

0 0
0 0

This article highlights findings from CoinDesk Research's new Q1 2017 State of Blockchain report, focusing on data around the growth of bitcoin's blockchain.

Click here to view the slides in your browser.

Click here to download the slides as a PDF.

Born from math, bitcoin is a game of numbers.

Transactions have a size of ~500 bytes, blocks are limited to 1 MB and blocks can only be published after a puzzle is solved, a process that occurs via algorithm once every ~10 minutes.

The facts that underlie the current bitcoin protocol, set years before transactions could ever be called 'expensive', set the stage for the 'scaling debate' we've watched unfold ever since. Proposals have since developed to decrease transaction sizes, remove the block size limit and move transactions off of the main bitcoin blockchain, all in the name of boosting capacity.

Amid this indecision, the network itself has adapted.

As bitcoin miners can...

0 0
0 0