It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
import math, os, random
random.seed("wefkw34DfsQ3A75")
stake_percent = raw_input("Enter stake percent of attacker (0.0000-1.0000): ")
blocks = raw_input("Enter number of blocks for simulation: ")
stakeholder_pool = raw_input("Enter number of random stakeholders: ")
stake_requirement = raw_input("Enter stake requirement to invalidate block: ")
blocks_passed = 0
blocks_invalidated = 0
print("Calculating...")
for i in range(int(blocks)):
vote_sum = 0 # The total number of attacker votes
for j in range(int(stakeholder_pool)): # Run loop for all stakeholder tickets
if float(stake_percent) > random.random(): # Calculate whether or not a ticket has been afforded to a malicious or non-malicious stakeholder
vote_sum += 1 # If it has been given to an attacker, add +1 attacker votes towards invalidating the block
if vote_sum < int(stake_requirement): # If we have don't enough attacker votes...
blocks_passed += 1 # The block passes through the blockchain as valid
else:
blocks_invalidated += 1 # The block is invalidated by the attacker
final_percent = float(blocks_invalidated) / (float(blocks_passed) + float(blocks_invalidated))
print("Blocks passed: " + str(blocks_passed))
print("Blocks invalidated: " + str(blocks_invalidated))
print("Percentage of blocks invalidated: " + str(final_percent))
Enter stake percent of attacker (0.0000-1.0000): 0.2000
Enter number of blocks for simulation: 100000
Enter number of random stakeholders: 5
Enter stake requirement to invalidate block: 1
Calculating...
Blocks passed: 32712
Blocks invalidated: 67288
Percentage of blocks invalidated: 0.67288
Enter stake percent of attacker (0.0000-1.0000): 0.2000
Enter number of blocks for simulation: 100000
Enter number of random stakeholders: 5
Enter stake requirement to invalidate block: 3
Calculating...
Blocks passed: 94160
Blocks invalidated: 5840
Percentage of blocks invalidated: 0.0584
Enter stake percent of attacker (0.0000-1.0000): 0.5100
Enter number of blocks for simulation: 100000
Enter number of random stakeholders: 5
Enter stake requirement to invalidate block: 1
Calculating...
Blocks passed: 2855
Blocks invalidated: 97145
Percentage of blocks invalidated: 0.97145
Enter stake percent of attacker (0.0000-1.0000): 0.5100
Enter number of blocks for simulation: 100000
Enter number of random stakeholders: 5
Enter stake requirement to invalidate block: 3
Calculating...
Blocks passed: 47981
Blocks invalidated: 52019
Percentage of blocks invalidated: 0.52019