bitcoin unspent inputs

I’m adding entries to my list of objections to raising the maximum block size as I run across them in discussions on reddit, in IRC, etc. This is the technical objection that I’m most worried about: More transactions means more memory for the UTXO database I wasn’t worried about it yesterday, because I hadn’t looked at the trends.I am worried about it today.But let me back up and explain briefly what the UTXO database is.UTXO is geek-speak for “unspent transaction output.” Unspent transaction outputs are important because fully validating nodes use them to figure out whether or not transactions are valid– all inputs to a transaction must be in the UTXO database for it to be valid.If an input is not in the UTXO database, then either the transaction is trying to double-spend some bitcoins that were already spent or the transaction is trying to spend bitcoins that don’t exist.Jameson Lopp’s statoshi.info web site keeps track of the size of the UTXO database over time.

Over the last 11 months it looks like this: So the UTXO size has doubled in the last year.That would be OK if the price of memory was halving every year, but memory prices dropped only about 20% last year.Even assuming Moore’s Law kicks in again as new memory chip technologies roll out we would still have the UTXO set growth outpacing the advance of technology.Today, the UTXO database is about 650MiB on disk, 4GB when decompressed into memory.DRAM costs about $10 per GB, so you need to spend about $40 on memory if you want absolute fastest access to the UTXO.Not a big deal.Assuming the UTXO set continues to double and RAM prices continue to drop 20% per year, next year you’ll have to spend about $64.Ten years from now, over $4,000… … except the maximum block size will stop the exponential growth.A one megabyte block is room for about 100 million 500-byte transactions per year.If every one of them increased the UTXO set by 500 bytes, that would grow the UTXO set 50 gigabytes a year.

So very worst case running a full node with the entire UTXO set in RAM is $500 per year, at today’s DRAM prices.That cost would decline as memory prices fell.Allowing more transactions with no other changes would very likely accelerate the UTXO set growth, making it more expensive, more quickly, to run a fully validating node.And worst case would be twenty times as expensive; $10,000 per year.
bitcoin simon hausdorfAffordable for a business, not for an individual.
bitcoin pinautomaat den haagThat is a very good reason to oppose increasing the maximum block size.
bitcoin hobbies reviewsBut is the worst case realistic?
bitcoin jasakom

The entire UTXO set doesn’t have to be in RAM; it can be stored on an SSD or spinning hard disk.The access pattern to the UTXO is not random; outputs that were spent recently are more likely to be re-spent than outputs that have not been spent in a long time.Bitcoin Core already has a multi-level UTXO cache, thanks to the hard work of Pieter Wuille.
bitcoin miner virusSolid-state-disk (SSD) prices are about $0.50 per GB, spinning disks are about $0.05 per GB.
lucian ivan bitcoinWorst case UTXO storage for 20MB blocks is about one terabyte per year, or $500 per year at today’s SSD prices.$50 per year at today’s hard disk prices.That’s not so bad!But there is a tradeoff – if you don’t store the entire UTXO set in DRAM, then it will take you longer to validate blocks.How much longer depends on how much memory you’re dedicating to the UTXO cache, the speed of your SSD or hard drive, and how well a new block’s transactions match typical transaction patterns.

Unless you are mining, taking longer to validate new blocks isn’t a problem as long as you can validate them fast enough to keep up with the 10-minute-average block time.If you are mining, then taking longer to validate new blocks puts you at a disadvantage, because you can’t (or, at least, shouldn’t) start mining on the new best chain until you’ve fully validated the new block.I’ll write about that more when I respond to the “Bigger blocks give bigger miners an economic advantage” objection.90% transaction fee, how can this be avoided?(self.Bitcoin)submitted by Trying to send my total balance of: 0.07047255 I have 175 Transactions with this address currently, I have been using it to receive payout from affiliate links for a couple months now.However, blockchain.info (custom send) wants me to pay a transaction fee of 0.06349319 which is like 90% of everything in there.I've learn my lesson this time but how can this be avoided in the future?How can I receive payouts from affiliates without accumulating so many transactions and requiring manual intervention?

Edit: The total balance isn't comprised solely of micro transactions, here are some of my larger ones: 0.04457552 0.00999998 0.005736 0.00337 0.001002 https://blockchain.info/address/19M6Z8e8NwLJMs4qkh7FzUoUV1wZF1rLij Not sure if that helps, Thank you!Edit: Thank you to /u/peterwemm for this comment.This seems to be the best course of action for anyone in a similar situation, Thanks for your comments everyone!π Rendered by PID 129704 on app-223 at 2017-06-23 23:53:32.840883+00:00 running 3522178 country code: SG.Explore MultiChain’s low level interface for building transactions As an alternative to high-level APIs such as send, issue, publish, create, grant and revoke, MultiChain’s raw transaction APIs provide more control over the creation and signing of blockchain transactions.There are several possible reasons for using raw transactions: These MultiChain APIs are backward compatible with Bitcoin Core’s raw transaction APIs, while offering significant additional functionality.

Some of this functionality is related to MultiChain’s native assets, data streams and permissions, but there are also new calls like appendrawchange and appendrawdata which can be useful for bitcoin-style blockchains.The examples below assume that you already have a MultiChain blockchain up and running on at least one node, that it is not using a native currency (as per the defaults), and that your node has at least one address with admin, issue and create permissions.If you don’t have this available, follow the instructions in section 1 of the Getting Started guide and then run multichain-cli chain1 to enter interactive mode for your chain.The first set of examples shows how to build and send complex transactions in a single step, using API and protocol features introduced in MultiChain 1.0 alpha 27.The second set uses a more traditional approach, building up the raw transactions stage-by-stage.While the second set is slower, it provides deeper insight into the structure of MultiChain transactions.

In either case, after entering an API command in multichain-cli, you can see the exact form of the JSON-RPC request in the first line of the response.First let’s identify an address that can be used for issuing assets: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)Now let’s create two assets to be used for sending in transactions: issue asset3 100 0.1 issue asset4 100 0.1 Now let’s create two new addresses for receiving these assets: Copy and paste the first displayed address here: Copy and paste the second displayed address here: Now let’s grant these addresses receive and send permissions: Now we’re going to send some of the newly created assets from the current holding address to these two addresses, along with some metadata: createrawsendfrom '{"":{"asset3":20,"asset4":30},"":{"asset3":30,"asset4":20}}' '["5554584f732046545721"]' send The output from this command should contain a regular looking transaction ID.

You can now check the transfer was successful by checking the balances of the three addresses for the two new assets, which should be (50 and 50), (20 and 30) and (30 and 20) respectively: getaddressbalances 0 getaddressbalances 0 getaddressbalances 0 In addition you can view the metadata within the transaction by retrieving it from the wallet and looking in the data element: Let’s begin by identifying an address that can be used for issuing assets: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)Now let’s create two new addresses for receiving these assets: Copy and paste the first displayed address here: Copy and paste the second displayed address here: Now let’s grant these addresses receive and send permissions: Now let’s create a transaction which issues a new asset using the appropriate address to these two new addresses, and includes information about the asset: createrawsendfrom '{"":{"issue":{"raw":2000}},"":{"issue":{"raw":3000}}}' '[{"create":"asset","name":"asset8","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}]' send The output from this command should contain a regular looking transaction ID.

You can now check the issuance was successful by getting information about the new asset created: In addition you can check that the two addresses received 200 and 300 units respectively: getaddressbalances 0 getaddressbalances 0 Now we can perform a second issuance of the same asset, since it was created as open: createrawsendfrom '{"":{"issuemore":{"asset":"asset8","raw":500}},"":{"issuemore":{"asset":"asset8","raw":500}}}' '[{"update":"asset8","details":{"origin":"us","stage":"two"}}]' send The output from this command should contain a regular looking transaction ID.You can now check the issuance was successful by getting the full information about this asset: In addition you can check that the two addresses received an additional 50 units each: getaddressbalances 0 getaddressbalances 0 Let’s begin by identifying an address that can be used for creating streams: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)

First let’s create two open streams and then subscribe to them: createfrom stream stream3 true createfrom stream stream4 true subscribe '["stream3","stream4"]' Now let’s send a single transaction that sends no assets but publishes two stream items simultaneously from the same address: createrawsendfrom '{}' '[{"for":"stream3","key":"key1","data":"4f6e65206974656d"},{"for":"stream4","key":"key2","data":"416e6f74686572206974656d"}]' send You should now be able to see the published items: We begin by finding an address that has the create permissions required for creating streams: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)Now let’s create the stream using data in a raw transaction with no other outputs: createrawsendfrom '{}' '[{"create":"stream","name":"stream8","open":false,"details":{"geo":"japan","origin":"BoJ"}}]' send A transaction ID should be output, and the stream should also now be visible: Note that the address which created the stream has admin, activate and write permissions.

Now we’ll add write permissions for a new address to this stream.First, generate the new address: Copy and paste the displayed address here: Now let’s grant stream write permissions for this address by sending a raw transaction: createrawsendfrom '{"":{"permissions":{"for":"stream8","type":"write"}}}' '[]' send A transaction ID should be output, and the new permission should now be visible: Let’s begin by identifying an address that has the admin permissions required for changing the permissions of other addresses: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)Now let’s create two new addresses for receiving permissions changes: Copy and paste the first displayed address here: Copy and paste the second displayed address here: Now let’s send a raw transaction which grants permanent connect and receive permissions to the first address, and temporary connect-only permissions to the second address: createrawsendfrom '{"":{"permissions":{"type":"connect,receive"}},"":{"permissions":{"type":"connect","startblock":0,"endblock":10000}}}' '[]' send The output from this command should contain a regular looking transaction ID.

You can now check the permissions grant was successful: Now let’s send a raw transaction which revokes the receive permission that had been given to the first address, and grant it a send permission instead.Note that a permission is revoked by “granting” it with a startblock and endblock of 0: createrawsendfrom '{"":{"permissions":{"type":"receive","startblock":0,"endblock":0}},"":{"permissions":{"type":"send"}}}' '[]' send The output from this command should contain a regular looking transaction ID.You can now check the permissions change was successful: First let’s identify an address that can be used for issuing assets: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)Now let’s create two assets to be used for sending in transactions: issue asset5 100 0.1 issue asset6 100 0.1 Now let’s create two new addresses for receiving these assets: Copy and paste the first displayed address here: Copy and paste the second displayed address here: Now let’s grant these addresses receive and send permissions: Now we’re going to build a raw transaction which sends some of the newly created assets from the current holding address to these two addresses, along with some metadata.

First let’s list the unspent outputs belonging to the holding address: Look down this list for a transaction output containing 100 units of asset5 within its assets element.This is the first output we will spend.Copy and paste the txid for asset5: Copy and paste the vout for asset5: Now look down that same list for a second transaction output containing 100 units of asset6.This is the second one we will spend.Copy and paste the txid for asset6: Copy and paste the vout for asset6: You can verify these transaction outputs’ contents by calling: gettxout gettxout Now let’s start building the raw transaction to send 20 units of asset5 and 30 units of asset6 to the first new address, and the reversed quantities to the second new address: This should output a large hexadecimal blob, which contains the raw created transaction.You can view this transaction’s contents using: The vin array of the output shows the two inputs being spent, and the vout array shows the two outputs including their assets.

However this transaction is not yet ready for signing, because its input contains 100 units of each issued asset, whereas its outputs only contain 50 units of each asset so far.Transactions which have unbalanced asset quantities between their inputs and outputs are not valid, so we need add a change output which returns the remaining units to the sender: This should output a longer hexadecimal blob, to which we’ll now add some metadata: This should output an even longer hex blob, which can be decoded using: You should now see three elements in the vout array as well as a data field showing the metadata.Now we can finally sign this transaction: The output should contain our final transaction in a yet even longer hexadecimal blob of text, alongside another field complete whose value is true.The signed transaction can be transmitted to the network: The output from this command should contain a regular looking transaction ID.Now let’s create two new addresses for receiving these assets: Copy and paste the first displayed address here: Copy and paste the second displayed address here: Now let’s grant these addresses receive and send permissions: Now let’s prepare an unspent transaction output for the issuing address, containing no assets.

This will be used as the input for the issuance transaction, to provide proof that the issuance was authorized by an address with issue permissions: Copy and paste the txid displayed: Copy and paste the vout displayed: Now we’re going to prepare a raw transaction which creates a new asset and immediately sends units to the two new addresses: This should output a hexadecimal blob of data containing a raw transaction to issue 2000 raw units of the asset to the first address, and 3000 raw units to the second address.Now we need to add metadata to this transaction to give more information about the issuance, including the name asset7, the ratio of 10 raw units per display unit, the fact that it is open for further issuances, and other custom fields: This should output an longer hex blob, which we can now examine: You should see three outputs – two containing the asset quantity to be issued and one with the metadata representing the asset details.Now we can sign this transaction: The output should contain our final transaction in a longer hexadecimal blob of text, alongside another field complete whose value is true.

You can now check the issuance was successful by getting information about the new asset created: In addition you can check that the two addresses received 200 and 300 units respectively: getaddressbalances 0 getaddressbalances 0 Now we can perform a second issuance of the same asset, since it was created as open.First, we prepare another input: Copy and paste the txid displayed: Copy and paste the vout displayed: Now we’re going to prepare a raw transaction which represents a follow-on issuance to the same two addresses: This should output a hexadecimal blob of data containing a raw transaction to issue 500 raw units of the asset to each of the two addresses.Now we need to add metadata to this transaction to add some custom fields to the follow-on issuance: This should output an longer hex blob, which we can now examine: You should see three outputs – two containing the additional asset quantity to be issued and one with the metadata representing the details of the new issuance.

You can now check the issuance was successful by getting the full information about this asset: In addition you can check that the two addresses received an additional 50 units each: getaddressbalances 0 getaddressbalances 0 First let’s create two open streams (this requires the node to have an address with create permissions) and then subscribe to them: create stream stream5 true create stream stream6 true subscribe stream5 subscribe stream6 Now let’s prepare an unspent transaction output to be used for the publishing transaction, containing no assets: Copy and paste the txid displayed: Copy and paste the vout displayed: Now we start building a raw transaction which does not need any regular outputs: This should output a hexadecimal blob, which contains the raw created transaction.Let’s add the first stream item: This should output a longer hexadecimal blob, to which we’ll add the item for the second stream: Note that it’s not possible to create multiple items for the same stream in one transaction.

Now we can sign this transaction: The output contains the final transaction in an even longer hexadecimal blob, with a field complete whose value should be true.The signed transaction can be broadcast: You should now be able to see the published items: We begin by finding an address that has the create permissions required for creating streams: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)Now let’s prepare an unspent transaction output to be used for the stream creation, containing no assets: Copy and paste the txid displayed: Copy and paste the vout displayed: Now we start building a raw transaction which does not need any regular outputs: This should output a hexadecimal blob, which contains the raw created transaction.Let’s add metadata to create a stream: This should output a longer hex blob.Now we can sign this transaction: The output should contain the final signed transaction in a longer hexadecimal blob, alongside a complete value of true.

This signed transaction can be broadcast: A transaction ID should be output, and the stream should also now be visible: Note that the address which created the stream has admin, activate and write permissions.First, generate the new address: Copy and paste the displayed address here: Now let’s prepare an unspent transaction output to be used for the stream permission change, containing no assets: Copy and paste the txid displayed: Copy and paste the vout displayed: Now we’ll build a raw transaction which grants the permission (see the next section for examples of the optional startblock and endblock parameters): This should output a hexadecimal blob, which contains the raw transaction for assigning the permissions.We can now sign this transaction: The output should contain the final signed transaction in a longer hexadecimal blob, with a complete value of true.This signed transaction can be broadcast: A transaction ID should be output, and the new permission should now be visible: Let’s begin by identifying an address that has the admin permissions required for changing the permissions of other addresses: Copy and paste the displayed address here: (If multiple addresses are displayed, use the getaddresses true command to see which addresses belong to the local wallet.)

Now let’s create two new addresses for receiving permissions changes: Copy and paste the first displayed address here: Copy and paste the second displayed address here: Now let’s prepare an unspent transaction output for the admin address, containing no assets.This will be used as the input for the permissions transaction, to provide proof that it was authorized by an address with admin permissions: Copy and paste the txid displayed: Copy and paste the vout displayed: Now we’re going to prepare a raw transaction which grants permanent connect and receive permissions to the first address, and temporary connect-only permissions to the second address: This should output a hexadecimal blob containing the raw transaction, which we can now examine: You should see two outputs containing the two addresses and the permissions to be assigned to them.You can now check the permissions grant was successful: Now let’s revoke the receive permission that had been given to the first address, and grant it a send permission instead.