Alternatively, you could use the api's generateCommand functions to generate any command, return this command to the user, and request that they sign it manually. You can then take that signature, and call sendSignedCommand. This is more of a hassle, but allows trustless apps to interface with the server. This article will assume that the private key is set, as this allows for simpler examples, but a few minor edits would make any application work in a trustless manner.netvend.setPrivkey(your_privkey) netvend.setSeed('some seed')
Data stores arbitrary data into the database, which is public and transparent. This data can be retrieved by anyone running the Query command, and is easy to be mined, sorted, and just generally analyzed if anyone's interested enough to structure an SQL query. However, this data may also be encrypted using any encryption techniques the developer wants to use, since the server processes the command regardless of the nature of the data. This will enable clever developers to quickly and easily build apps that can dependably utilize a neutral storage space for any encrypted or non-encrypted communication the app needs to use. Note that because this is a paid service, the server has a more inherent tendency to stability that other similar free services do not. With a sufficient community, it can be assumed that a fairly recent backup of the database will always exist somewhere. This means that even in the event of the NetVend server disappearing without a trace, another incarnation of it can easily be created and restored to a very recent state. In summary, the Data command stores a piece of data, publicly, for anyone to easily find, forever.response = netvend.commandData("Your first NetVend data upload!") success = response if (success) data_id = response['command_response'] #the value of data_id can now be used by anyone with the Query command to retrieve this data entry.
Tip sends internal credit from one account to another, specified by that account's Bitcoin address. These are not native Bitcoin transactions, and therefore they require some degree of trust--but are still verifiable in their own way (see the technical writeup). However, because the blockchain isn't used, some limitations of traditional Bitcoin transactions are avoided. Tips are much cheaper than Bitcoin transactions (one Bitcoin transaction cost would pay for the cost of over 1 million NetVend tips), they're virtually instantaneous, and they have the precision of 1/1000000 of a Satoshi (1 uSat). Because NetVend accounts are based on a bitcoin address and the corresponding signatures, funds can be sent to any Bitcoin user regardless of whether they currently use the service. This is because the recipient can always claim or control those funds by sending commands signed with their private key.response = netvend.commandTip(aFriendsAddress,5000000,0) #tip aFriendsAddress 5 satoshis' worth of uSats, referencing 0 as a data entry (interpreted as no data entry) success = response if (success) tip_id = response['command_response'] #the value of tip_id can now be used in a manner similar to data_id, seen above.
Query accesses any of the public database tables (accounts, commands, data, tips) with any valid SQL SELECT query. All valid SQL SELECT queries are accepted and returned, excepting timeout issues. This allows anything (again, user or script) to comb through all public data (remember, however, that data can be encrypted) with that most perceptive tool--an SQL SELECT query, either simple or complex. This is how a client must gain any information about an account or anything else on the server directly, which means that a new account must receive either a direct Bitcoin deposit or a smaller tip from another NetVend account to access any information (Again, during the beta, we will be funding as much of this activity as we can).query = "SELECT id,data FROM data WHERE id < 10" #SELECT id,data Get the data id and the data itself #FROM data from the "data" table #WHERE id < 10 for the first 10 data entries response = netvend.commandQuery(query,2000) #send the query with a max_fee of 2000 uSats (=0.002 Satoshis) success = response if (success): rows = response['command_response']['rows'] for row in rows: print "data entry number " + str(row) + " says " + str(row) #iterates through all returned rows, and prints out the data id and data of each entry
import netvend chbs = netvend.Netvend('correct horse battery staple', seed=True)#use the seed 'correct horse battery staple' to create an identity #if we wanted the address of this identity, chbs.get_address() would tell us response = chbs.post("butts")Assuming the chbs identity had netvend credit, response should contain, among other things, the id of your brand new post on netvend.
import netvendtk def add_two(num): return num+2 service_agent = netvendtk.ServiceAgent('correct horse battery staple') print "service address: " + service_agent.get_address() service_agent.register_simple_service("add two", add_two, netvendtk.convert_value(0.01, 'mbtc', 'base')) batch_results = service_agent.work()First, we define a function. Any function would work, as long as the arguments and return values are json-encodable.
import netvendtk service_agent = netvendtk.ServiceAgent('bla') add_two_service_address = "1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T" result = service_agent.call(add_two_service_address, "add two", , netvendtk.convert_value(0.01, 'mbtc', 'base'))We specify the service address, the name of the service ("add two"), arguments (), and the fee we'd like to send (0.01 mbtc). This script's ServiceAgent then signs its own series of requests and commands (this is what the 0.05 satoshis are for), first requesting the service, then fetching the response that our first script posts in response.
if service_agent.fetch_balance() > netvendtk.convert_value(1, 'mbtc', 'base'): service_agent.withdraw(netvendtk.convert_value(1, 'mbtc', 'base'), your_bitcoin_address)This would withdraw 1 mBTC of credit into Bitcoin if your agent has that much. Any credit your agent makes could be withdrawn on an automatic schedule like this, or can be spent buying services from other agents and scripts.
sa = netvendtk.ServiceAgent('your super secret seed') to_send = raw_input("string to send: ") print sa.call("1GbceejVDAShYRRXaT2TDdWjxpqbazwphm", "get last string", [to_send], 0)(Note that since my service is taking a fee of 0, it will eventually run out of netvend credit and die.)
import netvendtk #the 'correct horse battery staple' agent has credit already, meant for public use. chbs = netvendtk.Agent('correct horse battery staple') #using an Agent (not a ServiceAgent) because we're only using the low-level pulse command. #A ServiceAgent is just an Agent with some more methods, #so the next line could use an Agent or ServiceAgent. #either one will generate the same address and use the same netvend account. #you'll want to change this seed, as this is meant to be your own secure agent. my_agent = netvendtk.Agent('a super secret and suitably random seed') #this will be the public address for the keypair held in my_agent, #and is needed to receive pulses of credit. my_agent_address = my_agent.get_address() #now, send a pulse of credit from the chbs agent to your agent's address. #specify 10 satoshi, converted to the 'base' netvend unit (uSats). #Please don't be greedy! 10 satoshis will last you way longer than you'd think. chbs.pulse(my_agent_address, netvendtk.convert_value(10, 'satoshi', 'base'))
This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. This means you're free to copy and share these comics (but not to sell them). More details.. mastermind horse battery staple. Ask Question Asked 5 years, 11 months ago. Active 5 years, 11 months ago. Viewed 7k times 48. 13 \$\begingroup\$ Objective. Given a list of three-word passphrases, crack them all. Each time you guess, you will be given a clue in the style of Mastermind, depicting how many characters match the password, and how many are in their correct position. The objective ... Bitcoin is a distributed, worldwide, decentralized digital money. Bitcoins are issued and managed without any central authority whatsoever: there is no government, company, or bank in charge of Bitcoin. You might be interested in Bitcoin if you like cryptography, distributed peer-to-peer systems, or economics. A large percentage of Bitcoin enthusiasts are libertarians, though people of all ... Every Bitcoin address is based on a secret key, from which the public key (associated to a Bitcoin address) is calculated. Once you have the private key for an address, you have the control of that address and can use it to transfer funds. This secret key is a 32-bytes unsigned integer. You can generate a lot of secret keys, calculate the public keys associated to them and see if they contain ... Using your own variant on “correct horse battery staple” for multiple accounts is also a bad idea, from a security and privacy perspective. A single compromised account could leak all the passwords to your email, Bitcoin exchange, and other sensitive accounts. Trying to memorize a different password for tens or even hundreds of accounts is ...
[index]          
The Media has lied about one of the most viral immigration stories. A viral photo of a crying little girl turned out to be a lie pushed by large media outlets. The little girl was never separated ... Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube. Friends, all pleasant viewing! My name is Vanya! I am the author of the channel HandCraft. On this channel I present everything that I have done with my own ... #homestead #firewood We end up with barrels and barrels of wood ash during the burning season, but there are so many things you can use the ASH for. In today... NOTE: Yes I noticed The Gaffe saying Beto was running for Congress and I do correct that in the video. Far left Democrats Are Failing In Their Districts, Abysmal Polling And Almost No Top Donors.