Bitcoin Forum
May 26, 2024, 09:06:36 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 [48] 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ... 112 »
941  Bitcoin / Development & Technical Discussion / Re: subvertx command line utilities (proof of concept using libbitcoin) on: November 09, 2011, 09:53:35 PM
Made updates to subvertx (updated OP but posting below also). Packages have also been refreshed so you may wish to update.

I split the process between creating a transaction and actually broadcasting it into 2 parts rather one command (for etotheipi mainly Wink). This artifice allows us all the whizz-bang toys like offline transactions, piping a transaction to multiple sends, a flyweight client, piping transactions over network shares to a single bitcoind and whatever guile schemes you can imagine. In shell we trust.

Code:
$ mktx
Usage: mktx COMMAND [ARGS]...

Commands:

  create    Create a new transaction and output the binary data
  send      Send a transaction to the network, reading from STDIN

Options:

 -p, --previous-output  Previous output in the form NAME@OUT:INDEX
 -k, --keypair      Load a keypair with an identifier NAME@FILE
            A single dash - for FILE will load from STDIN
 -r, --recipient    Specify a destination ADDRESS:AMOUNT
            AMOUNT uses internal bitcoin values
              0.1 BTC = 0.1 * 10^8 = 1000000
 -H, --host     Host of bitcoin node
 -P, --port     Port for bitcoin node
 -h, --help     This help text

Please email suggestions and questions to <genjix@riseup.net>.

There are 2 commands there. The 'create' actually constructs the transaction and then dumps its binary network format to STDOUT. 'send' reads from STDIN and sends it to the network. By default it sends to localhost:8333, but you can change it using the --host and --port options.

Creating a transaction

A transaction consists of inputs. You can use blockexplorer to look them up. Here are some examples.

1. We want to send from transaction c524c555aad1932c24c26ec20439a9caefc49f7c0df6d6bccced890ef980b45c's 0th output (which was sent to an address we own) to 2 addresses: 0.02 BTC to 12oabCifvHuxzXtYVGhkxVfWZDvKcU743s and 0.58 BTC to 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z

There is 1 previous output:

00535291532821f2e4879cf670f61396be32b9579400ae1119497f36f268eb40:1

There are 2 recipients:

12oabCifvHuxzXtYVGhkxVfWZDvKcU743s:2000000
14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z:58000000

Note that we use internal BTC amounts (decimal value * 10^8 - see help text).

Now to spend that output, it has to have been sent to an address you own, hopefully generated using the priv tool earlier Wink

Code:
$ mktx create -p priv@c524c555aad1932c24c26ec20439a9caefc49f7c0df6d6bccced890ef980b45c:0 -k priv@keys/privkey -r 12oabCifvHuxzXtYVGhkxVfWZDvKcU743s:2000000 -r 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z:58000000
... funny binary output here ...

If we wish to store that output we can use a redirection > to save it. Maybe store it on your USB and take it to another computer. Or we can pipe it straight to the send command.

Code:
$ mktx create -p priv@c524c555aad1932c24c26ec20439a9caefc49f7c0df6d6bccced890ef980b45c:0 -k priv@keys/privkey -r 12oabCifvHuxzXtYVGhkxVfWZDvKcU743s:2000000 -r 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z:58000000 | mktx send
1 peers connected.
s: version (85 bytes)
r: version (85 bytes)
s: verack (0 bytes)
r: verack (0 bytes)
Connected
s: tx (258 bytes)
c5 3e a3 b4 d4 4c cf 67 31 73 17 b2 bd 8d 0a 99 46 d8 2d 67 6c 02 d0 d1 13 2b 11 8f 95 d0 7f 57

The hash at the end is your transaction hash. If you do: tail -f .bitcoin/debug.log, or you look it up on bitcoincharts.com/bitcoin you will see that hash without the spaces (i.e CTRL-F for c53ea3 to see your transaction).

If you noticed, I loaded several private keys there using -k (or --keypair) KEYPAIR-NAME@FILENAME. You then reference which keypair belongs to which input this way.

2. Sending from three, different outputs to 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z.

Previous outputs:

00535291532821f2e4879cf670f61396be32b9579400ae1119497f36f268eb40:1
637f001eb4cbe165946c02a56bcb73822610f5886516169f98da6252266b7d8a:1
85b423b9c8c5c5277575b87d94dbcd4f87c1be578756eff6a9fde8b7d55749fb:1

All the outputs (in this case) use a different private key: ./keys/foo, ./keys/bar and ./keys/abc.

We can load the keys and name them (to have a way to refer to them) using:

 -k foo@keys/foo
 -k bar@keys/bar
 -k abc@keys/abc

And then indicate to mktx which key belongs with which inputs from above:

foo@00535291532821f2e4879cf670f61396be32b9579400ae1119497f36f268eb40:1
bar@637f001eb4cbe165946c02a56bcb73822610f5886516169f98da6252266b7d8a:1
abc@85b423b9c8c5c5277575b87d94dbcd4f87c1be578756eff6a9fde8b7d55749fb:1

1 recipient:

14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z:60000000

Code:
$ mktx create -p foo@00535291532821f2e4879cf670f61396be32b9579400ae1119497f36f268eb40:1 -p bar@637f001eb4cbe165946c02a56bcb73822610f5886516169f98da6252266b7d8a:1 -p abc@85b423b9c8c5c5277575b87d94dbcd4f87c1be578756eff6a9fde8b7d55749fb:1 -k foo@keys/foo -k bar@keys/bar -k abc@keys/abc -r 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z:60000000 | mktx send
1 peers connected.
s: version (85 bytes)
r: version (85 bytes)
s: verack (0 bytes)
r: verack (0 bytes)
Connected
s: tx (581 bytes)
c5 24 c5 55 aa d1 93 2c 24 c2 6e c2 04 39 a9 ca ef c4 9f 7c 0d f6 d6 bc cc ed 89 0e f9 80 b4 5c

942  Bitcoin / Project Development / Re: GLBSE: MAXKEISER.bitcoinfilm - fund Max Keisers Film "European Bitcoin - Prague" on: November 08, 2011, 09:52:44 PM
Ahh OK my bad Grin Yeah Mitchell Bourne has done an amazing job so he deserves our applause. *clap clap* He's been doing the heavy lifting behind the scenes trying to make it work.
943  Bitcoin / Project Development / Re: GLBSE: MAXKEISER.bitcoinfilm - fund Max Keisers Film "European Bitcoin - Prague" on: November 08, 2011, 07:48:11 PM
molecular, I'll let you in on the fact that funds are very tight, that organising a conference is no easy feat and extremely expensive. Anyway I'm not sure that the PMF guy there is Max Keiser since I remember Mitchell telling me when he was breaking down the costs that we have to pay for some flights. You can't fault that this conference is going to earn us negative money and a lot of effort and time has gone into it to benefit the community.

Also it still isn't confirmed 'officially' but Wikileaks is sending a spokesman + a prerecorded talk by Julian Assange (who wanted to but couldn't for obvious reasons Smiley)
944  Bitcoin / Bitcoin Discussion / Re: For very cautious Bitcoiners - Offline transactions. on: November 08, 2011, 04:55:50 PM
Quote
One thing I would love to see (and might experiment with) would be a C++ implementation of this that uses a console interface (stdin/stdout) to do this very same thing, and which has its own key store.

I released a tool to do all this a while back:

https://bitcointalk.org/index.php?topic=50721.0

Has Ubuntu, Gentoo and source code packages.
945  Bitcoin / Project Development / Re: Intersango exchange (formerly Britcoin) on: November 07, 2011, 09:42:25 PM
Hi,

Sorry for the week long delay with withdrawals. We haven't completely got setup with withdrawals yet, but we will manually be doing the larger withdrawals over the next few days; tomorrow will be withdrawals over 1000 GBP. The whole backlog should be completed once we are completely setup with the new bank which we expect to happen by the end of this working week (Friday).

Amir Taaki
946  Bitcoin / Bitcoin Discussion / Re: When will a real BANK accept Bitcoin ? on: November 07, 2011, 03:17:34 PM
I think it is good that flexcoin could never become a FED back (if it was going to I would more my coins out). I think the bitcoin community holds business owners to a high standard, than the government ever could.
As a community we need to look within ourselves to solve problems that we see around us. This idea of running to the “STATE”, the entity that is the reason why bitcoin was created, is dangerous to bitcoin.
The need for money transfers, without the “STATE”, can be solved by ingenuity.

Incidents at mtgox:
- No password brute force protection. People weren't recompensated.
- SQL injection.
- Leak of entire database.
- Using floats internally for orders.
- CSRF exploit. People weren't recompensated.
- Trying to partially blame us for discovering it after we spent all of 3 days trying to contact him (even rung a friend of his in France) before privately disclosing it to a trusted forum member to confirm.
- Intrusion and stealing of funds.
- Losing funds through using alpha bitcoin software.
- Not responding to reporters questions leaving the media to speculate.
... And more!

Mtgox is still the biggest exchange, and they kept their site up through these incidents when it should've been taken down until the problems were fixed.

when bitcoin.pl lost all their funds, they were up the next day and trading at 3/4 their previous volume.

Point is that people don't do shit. They will always keep using untrustworthy shoddy services. This posturing is all very well and nice, but a monopoly will keep dominating a market through either holding a first-entrant advantage (like bitcoin vs other future cryptocurrencies) or anti-competitve practices. Julian Assange (a guy that has read through thousands of leaked documents) agrees with me:

Quote
It’s not correct to put me in any one philosophical or economic camp, because I’ve learned from many. But one is American libertarianism, market libertarianism. So as far as markets are concerned I’m a libertarian, but I have enough expertise in politics and history to understand that a free market ends up as monopoly unless you force them to be free.
947  Bitcoin / Development & Technical Discussion / Re: Transaction Fee Clarifications on: November 07, 2011, 02:31:04 PM
Take a look at about every single transaction on blockexplorer. Most of them have fees.

And to avoid the tx-purgatory, we have the sequence numbers.
948  Bitcoin / Development & Technical Discussion / Re: Transaction Fee Clarifications on: November 07, 2011, 04:04:57 AM
I don't use a fee and my transactions send/confirm fine.

http://blockexplorer.com/tx/f5cffc95a4a83c23cb9f666c7cf552f27d9845778bb09a98d5169c461483ba41#i3150376
949  Bitcoin / Development & Technical Discussion / Re: subvertx command line utilities (proof of concept using libbitcoin) on: November 06, 2011, 09:01:39 PM
Updated the OP with the ebuild made by Kamil Domański.

Code:
layman -a bitcoin
emerge subvertx
950  Bitcoin / Wallet software / Re: libbitcoin on: November 06, 2011, 09:01:15 PM
Gentoo ebuild

Kamil Domański has made a gentoo ebuild.

Code:
layman -a bitcoin
emerge libbitcoin
951  Bitcoin / Meetups / Re: EUROPEAN BITCOIN CONFERENCE 2011, PRAGUE NOV 25-27 on: November 06, 2011, 07:23:12 PM
OK, I posted a pledge thread here:

https://bitcointalk.org/index.php?topic=51070.0

I PMed the Casascius guy to let him know.
952  Bitcoin / Bitcoin Discussion / Casascius coins pledge for European Bitcoin Conference on: November 06, 2011, 07:22:28 PM
OK, we will pool our monies and bulk buy some coins for the conference. Maybe have a poker home game with them or something Grin Buying in bulk is cheaper. Then afterwards the coins are split proportionally and you're free to do whatever you want such as resell them.

Post your pledges below and I'll update this OP. I'll get the Casascius guy to respond here. We'll bulk buy the coins and have them sent directly to the conference venue to collect.

Not sure how much I'm going to pledge yet, so for now say that I'm 0 BTC.

1LKaLcEjmyaKRvCnoyxoBBm5yQkmQ799tg
953  Bitcoin / Meetups / Re: EUROPEAN BITCOIN CONFERENCE 2011, PRAGUE NOV 25-27 on: November 06, 2011, 05:16:34 PM
Do anybody plan to sell Casascius coins on conference? It would be nice to buy few of them without paying overseas post...

Slush I can bring you a few.  how many do you want?
Bring as much as you can!
+1
I'd be willing to buy a few as well!

the casascius guy agreed to sell me a bunch of cheap coins if I buy in bulk. if you all message me, then we can maybe do something like we all pool our monies and everybody gets a share of X coins to do whatever they want with (resell them at the conference for profit .etc).

If there's sufficient interest then I'll make a new thread and get the casascius guy to post. Then we'll have the coins shipped directly to the conference venue.
954  Other / Off-topic / Re: Regarding resale of Windows XP Licenses on: November 06, 2011, 11:16:09 AM
Seems fine. He's stated what is what and isn't trying to mislead anyone. It's your own prerogative whether you want it or not.
955  Bitcoin / Development & Technical Discussion / Re: subvertx command line utilities (proof of concept using libbitcoin) on: November 06, 2011, 10:47:49 AM
@grondilu, I changed it according to your suggestions.

+1 To this.  I'm extremely interested in having a minimal networking interface just for getting txs not in the blockchain yet, and transmit new blocks that we just signed.  How much work would that be--it sounds like tests/net is like 90% of the way there.

I think you want this:
https://gitorious.org/libbitcoin/subvertx/blobs/master/src/mktx.cpp

However it doesn't do node discovery yet, so you have to know who you're connecting to beforehand.

You will need to modify mktx to be a new program that reads in a byte stream for the raw transaction.

See this:

https://gitorious.org/libbitcoin/libbitcoin/blobs/master/tests/dialect-test.cpp

If there is a problem reading the stream then it will throw an exception called end_of_stream. That exception is thrown by the internal deserialising object inside that dialect object:

https://gitorious.org/libbitcoin/libbitcoin/blobs/master/include/bitcoin/util/serializer.hpp

Quote
If I'm working on an AGPL v3 project, will I be able to use your code (modified or not) in my project with proper attribution?

Of course. It's a library. Don't worry about attribution.

Also, I changed the PPA from zgenjix -> genjix. Please update your sources.list and add the new keyserver
$ wget -q "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x3D1978972EC26E7B" -O- | sudo apt-key add -
956  Bitcoin / Wallet software / Re: Bitcoin-Qt, the future Bitcoin client GUI [user input needed] on: November 06, 2011, 02:03:24 AM
Question...I understand that Gavin and Satoshi have a super duper password to notify all clients to display a message.  Was this tested or included in the bitcoin-qt?

Can anyone clarify this?

https://en.bitcoin.it/wiki/Protocol_specification#alert
957  Bitcoin / Bitcoin Discussion / Re: Subvertx Ubuntu packages (Oneiric Ocelot only) on: November 06, 2011, 01:09:00 AM
Source installation instructions

You will need:

  - g++ 4.6
  - cppdb
  - boost
  - libpq-dev
  - postgresql

Build cppdb using the instructions on their site.

  $ svn co http://cppcms.svn.sourceforge.net/svnroot/cppcms/cppdb/trunk cppdb-trunk
  $ cd cppdb-trunk
  $ mkdir build
  $ cd build

You can use -DCMAKE_INSTALL_PREFIX if you wish to install to a non-standard place such as a local directory.

  $ cmake -DCMAKE_INSTALL_PREFIX=/tmp/cppdb/ ..  -DPQ_BACKEND_INTERNAL=1
  $ make
  # make install

Clone repo and build.

  $ git clone git://gitorious.org/libbitcoin/libbitcoin.git
  $ cd libbitcoin
  $ ./configure
  $ make
  # make install

Don't forget to initialise and create a database (see first post above for more details how).

  $ psql bitcoin < bitcoin.sql

Same for the subvertx suite

  $ git clone git://gitorious.org/libbitcoin/subvertx.git
  $ cd subvertx
  $ ./configure
  $ make
  # make install
958  Bitcoin / Bitcoin Discussion / Subvertx Ubuntu packages (Oneiric Ocelot only) on: November 06, 2011, 12:52:22 AM
Main thread: https://bitcointalk.org/index.php?topic=50721.0
Leave your comments there.

These are a simple set of utilities for working with the bitcoin network/protocol. Together you can use them as a 'flyweight' client. I like small sets of inter-working programs because it is the UNIX philosophy about building small bricks which you can piece together to create a set of highly configurable inter-locking mechanism of programs and daemons.

This is a proof of concept built off of the work-in-progress libbitcoin.

Subvertx is a suite of 4 tools:
- poller, downloads the blockchain from a bitcoind into a PostgreSQL database.
- balance, queries the PostgreSQL database downloaded with poller to find the balance of a bitcoin address.
- priv, create a new private key, sign data, verify data or show the bitcoin address of that key.
- mktx, connects to a bitcoind and sends some money from an output to a new address. You can use this in conjunction with a site like blockexplorer.com as a tool to make transactions very simply.

Show help:
Code:
genjix@random:~/subvertx$ priv 
Usage: priv [COMMAND] [ARGS]...

The priv commands are:
  new Generate a new private key and output to STDOUT
  sign Sign the next argument using the private key in STDIN
  verify Verify the next argument using the private key in STDIN
  address show the associated bitcoin address

genjix@random:~/subvertx$ mktx
Usage: mktx [HOST[:PORT]] [OUTPUT] [ADDRESS] [AMOUNT]

OUTPUT consists of a transaction hash and output index
  125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5:1
AMOUNT uses internal bitcoin values
  0.1 BTC = 0.1 * 10^8 = 1000000

genjix:~$ poller
poller [DBNAME] [DBUSER] [DBPASSWORD] [HOST:PORT] ...

genjix:~$ balance
Usage: balance [BACKEND] [ADDRESS]

BACKEND consists of a colon separated list of parameters.
  postgresql:database:username:password

Make a new private key, sign and verify a transaction hash:
Code:
genjix@random:~/subvertx$ priv new > /tmp/private_key
genjix@random:~/subvertx$ priv sign f5cffc95a4a83c23cb9f666c7cf552f27d9845778bb09a98d5169c461483ba41 < /tmp/private_key > signed_data
genjix@random:~/subvertx$ priv verify f5cffc95a4a83c23cb9f666c7cf552f27d9845778bb09a98d5169c461483ba41 "`cat signed_data`" < /tmp/private_key
1

Show your bitcoin address:
Code:
genjix@random:~/subvertx$ priv address < /tmp/private_key 
14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z

To send some bitcoins, you need to send some bitcoins to the address you generated above (in our case 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z). Then you need to search the transaction on blockexplorer and find which output it got sent to.

In our case, the bitcoins we sent went to transaction 125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5 (the hash) and output 1.

Our destination address will be: 14UZVX5q1EcE4aT5k1c3eqw3oNUiCN3T23

The amount of bitcoins to send is specified in the bitcoin internal format (which is amount * 10^8):
0.01 BTC = 100 0000

It will then connect to the bitcoind on localhost:8333 and send it the transaction, which will be propagated throughout the network.

Code:
genjix@random:~/subvertx$ mktx localhost 125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5:1 14UZVX5q1EcE4aT5k1c3eqw3oNUiCN3T23 1000000 < /tmp/private_key 
1 peers connected.
s: version (85 bytes)
r: version (85 bytes)
s: verack (0 bytes)
r: verack (0 bytes)
Connected
s: tx (225 bytes)
20 5b f8 0b 8e 5a 54 5d 1f 10 5d 8b 72 e5 ff fd e8 c6 fb e7 b9 b3 ac 4d 8f 8d f5 9b 26 58 82 12

Those numbers are the transaction hash which can be looked up on blockexplorer.

poller

To use the poller you first need to import the schema which can be downloaded from here (a pre-downloaded blockchain is here).

Code:
# do all the postgres stuff to make a new database
$ sudo su postgres
# createuser genjix
...
# psql
> CREATE DATABASE bitcoin;
> quit
# exit

$ wget http://libbitcoin.org/bitcoin.sql
$ psql bitcoin < bitcoin.sql

# it is a good idea to run this in screen
$ screen -S poller
$ poller bitcoin genjix psqlpassword localhost
... starts downloading the blockchain into postgresql
# now close the terminal. You can re-open the terminal with screen -x poller

Poller is doing full blockchain validation. It will take a long time since it's an SQL database and it's validating all the blocks.

Balance needs the full blockchain otherwise you might not get an up-to-date balance reported back. It's fairly simple to use:
Code:
$ balance postgresql:database:username:password 1jkjsjkdskjb2kkjbkjdsk

Ubuntu packages

The PPA can be viewed on launchpad.

Add these 2 lines to the end of your /etc/apt/sources.list
Code:
deb http://ppa.launchpad.net/genjix/libbitcoin/ubuntu oneiric main
deb-src http://ppa.launchpad.net/genjix/libbitcoin/ubuntu oneiric main

Code:
$ wget -q "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x4F8AE60DB3FC740E" -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install subvertx

This PPA also has a package for libbitcoin-dev although the API is undocumented at the moment. Grin

Kamil Domański is working on an gentoo ebuild which should be ready tomorrow.

Source code for the non-Ubuntu paupers:
https://gitorious.org/libbitcoin/libbitcoin
https://gitorious.org/libbitcoin/subvertx

I can't stress enough for people to use this at their own peril as it's alpha software.

Thanks goes to,

Kamil Domański (kdomanski)
Jan Engelhardt (se7) <jengelh@medozas.de>
Patrick Strateman (phantomcircuit)
Denis Roio (jaromil)
Amir Taaki (genjix) <genjix@riseup.net>
959  Bitcoin / Bitcoin Discussion / Re: Cheaper In Bitcoins | Explaination of the 0.01 Bitcent anomoly on: November 05, 2011, 10:04:46 PM
I just noticed that PHP will correctly round my example to 87.1 BTC along with the other one... however this was just an example of what I have found I can't find which product is showing these anomalies to use correct values for the example.. but basically my example should show you wants going on...

If you want to clip decimals, a good method to use is:

$foo = "8.91232323234223";
echo bcadd($foo, '0', 5);  // truncates to 5 decimal places

hope that helps.

Also, you should *always* round down and absorb the cost yourself.
960  Other / Off-topic / Re: Judge beats daughter for using the internet on: November 05, 2011, 09:55:28 PM
Justice,

http://yro.slashdot.org/story/11/11/05/1858223/no-charges-for-child-whipping-judge-caught-on-youtube
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 [48] 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ... 112 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!