About to find the maximum sum of transaction within a time window period

I received hundreds of transactions within one week. Each transaction has amount. I’d like to create an algorithm to find the maximum amount within 24 hour time window period. I know how to do that by creating a nested loop. But I am looking for a better performance algorithm such as n*Log(n) time complexity.

For example, the transaction data looks like:

[  {'05-05-2019:10.00.00', 100},  {'05-05-2019:11.00.00', 100}, {'05-05-2019:12.00.00', 100}, {'05-06-2019:10.00.00', 100},  {'05-06-2019:11.00.00', 100}, {'05-07-2019:10.30.00', 100}  ] 

For the above data, there are 6 transactions across 2 days. When calculate the 24 hours period time of transactions, there are 4 time period. The first three transactions happens within 24 hours which has a total amount as 300. The second time period includes three transactions, 2ed, 3rd and 4th which has a total of 300 amount. The third time period is 3rd, 4th and 5th has 300 amount. The fourth time period is 4th and 5th which is 200. The last time period is the last two which is 200. So the maximum amount is 300.

How much data does it take to prove a given transaction exists on the blockchain?

As I understand the SVP protocol, a client can be reasonably certain that a transaction has been accepted on the blockchain if they know it is a member of a certain block, via the Merkle path, and a reasonable number of blocks have been mined on top of that block.

How much total data would that be, roughly? I guess if you were beginning with 0 knowledge, you would need all of the block headers, beginning from the genesis block? But once you are convinced you are looking at the head of the right chain, you could discard all of the ancient block headers, and just save a recent one as a trusted starting point to evaluate subsequent transactions?


I guess the premise of my question is faulty, as a fake transaction could always be embedded in a fake chain, if enough computing resources were available. So, there is no amount of data that insures a transaction is valid, without access to other information, e.g., what is the longest chain currently in existence.

A better question for my purposes would be how much would the electricity cost to create one fake block header at today’s difficulty level? Figuring that blockchain currently pays around $ 60K to mine one block, I would guess it must be in that order of magnitude, though smaller since we are removing the race condition.

How much data does it take to prove a given transaction exists on the blockchain?

As I understand the SVP protocol, a client can be reasonably certain that a transaction has been accepted on the blockchain if they know it is a member of a certain block, via the Merkle path, and a reasonable number of blocks have been mined on top of that block.

How much total data would that be, roughly? I guess if you were beginning with 0 knowledge, you would need all of the block headers, beginning from the genesis block? But once you are convinced you are looking at the head of the right chain, you could discard all of the ancient block headers, and just save a recent one as a trusted starting point to evaluate subsequent transactions?


I guess the premise of my question is faulty, as a fake transaction could always be embedded in a fake chain, if enough computing resources were available. So, there is no amount of data that insures a transaction is valid, without access to other information, e.g., what is the longest chain currently in existence.

A better question for my purposes would be how much would the electricity cost to create one fake block header at today’s difficulty level? Figuring that blockchain currently pays around $ 60K to mine one block, I would guess it must be in that order of magnitude, though smaller since we are removing the race condition.

How to code bitcoin transaction for shopping cart

I have written website shopping cart software using MySQL and PHP and I need to add a way for users to pay with Bitcoin. This seems like a basic need for developers in general, but I’m having difficulty nailing down exactly how this works. Apologies in advance if this is a duplicated question!

The shopping cart shows the total amount due and when the user chooses to pay with Bitcoin, I imagine it should work like this:

shopping cart software generates a new payment (raw transaction?) address where the user should send their bitcoin payment.

Something (?) monitors the blockchain for the payment to this new address and updates the local database / user web interface to acknowledge when the payment is received.

I would appreciate any information clarifying the above processes!

A lot of searches about this including here on StackExchange are returning plugins for wordpress or joomla or such, but I don’t want to use one of those overloaded CMS packages. Perhaps there’s an existing API I would leverage but ideally I’d like to code as much of it myself as possible to limit the “unknowns” in the workings of this cart. tyvmia

How to track bitcoin transaction on PC

I am still quite new to Bitcoin, and my question may be a little bit stupid. So I am wondering how can I track the transaction or the newest block on my computer. I know there are tons of websites showing the real-time information, so I guess my question is like is there any way I can type something on my terminal of the PC and shows the data on it? Something like constructed the dataset on my own.

Bitcoin transaction query

I sent a bitcoin for exchange of etherium from blockchain But not received anything from the buyer for the past 48 hours. I am attaching the screenshot of two transactions where the second one is transfer from the my old btc to new btc account showing in green.

The next one is transfer from my new btc to seller account showing in red see the vallets 1HZCArUVZJCKKwmRVQWh78v3vHZJ2bGPcY is having nil balance 3HuQXaxerUujQw5kDbSyQLGERVTNvTBnn is having balance of 0.0049

Is it possible to recover my money ? Please adviseenter image description here

What happens if I send a XRP transaction to a blank TAG when I was supposed to send to a specifc TAG?

I sent XRP to a blank TAG while I was supposed to send to the √©xchange’s TAG. The address is the one from the exchange but the TAG was left blank. The exchange says that they can’t recover the money.

What happened to the money? Is it theoretically possible for the exchange to recover it? As I understood, a blank tag but rigth address will send the money to the exchange but not in the account of anyone.

ps: I just noticed that “crypto” stands for cryptograpy, not cryptocurrency, could someone move this to a better forum?

Miner transaction selection considering sigops

There is a limit on how much a block can sigop (set to 80000?). There is also a limit on how much a single transaction can sigop (set to 16000?). It thus seems possible (and if it’s not possible, the remaining of this question is void, but then how is it prevented?) that an attacker submits five special transactions to consume the whole block sigop limit. If such attacking transactions are using very generous fees per byte, if the miner chooses which transactions to include in a block based on fee per byte metric, it would include the attacking transactions in a block, getting relatively huge fees per byte, but not filling the block because of sigop limit. This would mean that the miner could get more in fees if it avoided attacking transactions, but the question is whether such selection avoidance is implemented by default.