https://bitcointalk.org/index.php?topic=259999$ sx newkey | gpg -o privkey.enc -e - $ gpg -d privkey.enc | sx addr
offline cold storage with encrypted private keys generated offline and encrypted using PGP. combine this with multisignature for multiple offline storage keys that need to be signed to release funds in case one key gets compromised. combine with deterministic wallet (sx newseed) and master public key (cat wallet.seed | sx mpk) for accepting payments straight to your multiple offline cold storage wallets.
|
|
|
Question: Does sx support multi-sig transactions?
multisignature now works: =============================== Multisignature N-M Transactions ===============================
This example will create a 2-3 multisignature transaction but these instructions can be easily generalised for other types.
Firstly we will create 3 keypairs.
$ sx newkey > key1 $ cat key1 | sx addr 15xG6FE45vjuEdQQamvvgRPzrdzvZAxAyJ $ sx newkey > key2 $ cat key2 | sx addr 12GhrHLu4K5LL8hNkyMZZXz3u7QJc5Qjsc $ sx newkey > key3 $ cat key3 | sx addr 1KWv6rPrXzggQNkQrz8Leq1DhDm1b3y23r
For multisignature stuff we will need to use the public keys of the keypairs. We use bash substitution below for convenience.
$ sx rawscript 2 [ $(cat key1 | sx pubkey) ] [ $(cat key2 | sx pubkey) ] [ $(cat key3 | sx pubkey) ] 3 checkmultisig > msig.script
The file 'msig.script' now stores the hex representation of that script. We can display it at anytime using:
$ cat msig.script | sx showscript 2 [ 04cb9c3c222c5f7a7d3b9bd152f363a0b6d54c9eb312c4d4f9af1e8551b6c421a6a4ab0e29105f24de20ff463c1c91fcf3bf662cdde4783d4799f787cb7c08869b ] [ 04ccc588420deeebea22a7e900cc8b68620d2212c374604e3487ca08f1ff3ae12bdc639514d0ec8612a2d3c519f084d9a00cbbe3b53d071e9b09e71e610b036aa2 ] [ 04ab47ad1939edcb3db65f7fedea62bbf781c5410d3f22a7a3a56ffefb2238af8627363bdf2ed97c1f89784a1aecdb43384f11d2acc64443c7fc299cef0400421a ] 3 checkmultisig
Now we generate the multisignature Bitcoin address (which always begins with the number 3):
$ cat msig.script | sx scripthash 34CRZpt8j81rgh9QhzuBepqPi4cBQSjhjr
Send some bitcoin to that address!
This is my transaction:
https://blockchain.info/tx/e2124d25a7f6fe0d5dd5dd78ba7d98f60f8c47be9c91699e649e04118d531f52
--------------------------------- Spending the multisignature coins ---------------------------------
We create the basic transaction.
$ sx mktx txfile.tx -i e2124d25a7f6fe0d5dd5dd78ba7d98f60f8c47be9c91699e649e04118d531f52:0 -o 1Fufjpf9RM2aQsGedhSpbSCGRHrmLMJ7yY:9900000 Added input e2124d25a7f6fe0d5dd5dd78ba7d98f60f8c47be9c91699e649e04118d531f52:0 Added output sending 9900000 Satoshis to 1Fufjpf9RM2aQsGedhSpbSCGRHrmLMJ7yY.
The transaction has a fee of 0.001 BTC and is saved in the file named 'txfile.tx'.
It has a single input which we will generate the signatures for, create the script and then set the input.
Use the sx command 'showtx' to show a transaction.
In our example we will emit the first signature and only use key2 and key3.
We use the opcode 'zero' to represent the emitted signature of key1.
Sign an input using:
$ cat key2 | sx sign-input txfile.tx 0 $(cat msig.script) 3046022100a147c529f7dfa291ceb2c2f21094ca101a1cfe7036cda18935d6899111cad76b022100c0d6392bdd9b31e0e3fe13dce3d928cf6857b411b6e05f35f12403b877c26bad01 $ cat key3 | sx sign-input txfile.tx 0 $(cat msig.script) 3046022100957f0bfdd476f2d8985268d7964168f6b7e43f54089f8fbff35a4f62e7a221f9022100be8f565e30781d353d71f54202009fe14b8203151d235ba6bf3db2b531680bca01
Our example will use bash substitution again.
$ sx rawscript zero [ $(cat key2 | sx sign-input txfile.tx 0 $(cat msig.script)) ] [ $(cat key3 | sx sign-input txfile.tx 0 $(cat msig.script)) ] [ $(cat msig.script) ] | sx set-input txfile.tx 0
The transaction is finalised! Broadcast it:
$ sx broadcast-tx txfile.tx
https://blockchain.info/tx/d646f82bd5fbdb94a36872ce460f97662b80c3050ad3209bef9d1e398ea277ab
offline multisignature tx = micropayment channels (exchange raw tx, sign your input, exchange signatures) or you can do offline tx + MPK with multisig for doubly secure offline wallet.
|
|
|
Lots of new things coming. I'm at a basic milestone where I'm content with the overall internal architecture of the library now. https://github.com/spesmilo/libbitcoin/commits/masterNext steps is Python bindings, and a blockchain query API. The Python bindings were done before but were experimental. We had some issues with asynchronous calls and the GIL. I'm thinking to simply turn all async calls into sync blocking ones for Python anyway (keep it simple). The query layer is something really nice: https://github.com/genjix/query-layer(see the tutorial.py) You can move around and examine it using logical Python constructs. I want to expand upon this and also give access to new blocks and verified transactions in the memory pool. Then create an Electrum server protocol implementation chained to this. Also subvertx (command line tools for Bitcoin using libbitcoin) is a bit out of date and not actively developed. I would like to take that to something serious too but it needs time (if someone wants to volunteer, this is a cool project) to firstly create how the tools should look and then implement them. I can help someone with that if they know C++. https://github.com/genjix/subvertxhttps://bitcointalk.org/index.php?topic=50721.0Finally I'm working on an Android wallet. It's not using libbitcoin currently, but eventually that will be needed in the future. There's some other various small tools I've made too. One is a fast-monitor tool which sits in the Bitcoin network and looks at transaction outputs in new blocks and unconfirmed transactions for an address so it can tell a website of a new deposit. The tool doesn't validate the new blocks or transactions and is only meant to be a lightweight thing. I don't see it having too many uses except where a website has TONS of Bitcoin addresses and can't afford to poll the balance for all of them or something. Most of these goals have been reached. query API: https://github.com/genjix/obelisksubvertx (now sx): https://sx.dyne.org/Next stage is I need a final class for watching an address and giving credit/debit updates, and adding multisig to sx tools. We're moving into wallet development soon, and other exciting projects to push the boundaries of Bitcoin development.
|
|
|
yeah it returns one, but the tx is still valid in the blockchain. i know it's a big wtf.
the actual hash looks like 00 00 00 ... 00 01 (last byte is 0x01 but all the rest is 0x00).
|
|
|
Not yet. Will do. New easy install/update script: START HERE: $ wget http://sx.dyne.org/install-sx.sh $ sudo bash ./install-sx.sh
sx should now be installed. Enjoy! Special thanks to Andrew Day and Vitalik Buterin. Big thanks to Santiago Mendez who put in the time to help me improve the tools offering valuable feedback.
|
|
|
Created a nice cheatsheet.
|
|
|
Very cool. It is much like my recently introduced txtool utility. I tend to prefer the git-like sub-command model, rather than putting all the utilities in PATH. Yeah the point is that the installer should put them in a non-default location with a prefix like sx.newkey and then a bash script provides the wrapper on top together with the help and everything.
|
|
|
Interesting, I can see how these tools could be extremely useful for sysadmins and power users.
You mentioned deterministic wallets, are these BIP-32 compatible?
No, they are Electrum compatible. BIP-32 wallets will happen once Electrum and other clients start using them, and I have an implementation to follow and understand how to design a nice API for libbitcoin.
|
|
|
Website (tutorial): https://sx.dyne.org/List of commands: $ sx help Usage: sx COMMAND [ARGS]...
-c, --config Specify a config file
The sx commands are:
CREATE TRANSACTIONS mktx Create an unsigned tx. rawscript Create the raw hex representation from a script. set-input Set a transaction input. sign-input Sign a transaction input.
DETERMINISTIC KEYS AND ADDRESSES genaddr Generate a Bitcoin address deterministically from a wallet seed or master public key. genpriv Generate a private key deterministically from a seed. genpub Generate a public key deterministically from a wallet seed or master public key. mpk Extract a master public key from a deterministic wallet seed. newseed Create a new deterministic wallet seed.
TRANSACTION PARSING showscript Show the details of a raw script. showtx Show the details of a transaction.
BLOCKCHAIN QUERIES (blockexplorer.com) blke-fetch-transaction Fetches a transaction from blockexplorer.com
FORMAT base58-decode Convert from base58 to hex base58-encode Convert from hex to base58 base58check-decode Convert from base58check to hex base58check-encode Convert from hex to base58check decode-addr Decode an address to its internal RIPEMD representation. embed-addr Generate an address used for embedding record of data into the blockchain. encode-addr Encode an address to base58check form. ripemd-hash RIPEMD hash data from STDIN. unwrap Validates checksum and recovers version byte and original data from hexstring. validaddr Validate an address. wrap Adds version byte and checksum to hexstring.
BRAINWALLET brainwallet Make a private key from a brainwallet mnemonic Work with Electrum compatible mnemonics (12 words wallet seed).
BLOCKCHAIN WATCHING monitor Monitor an address. watchtx Watch transactions from the network searching for a certain hash.
BLOCKCHAIN QUERIES (blockchain.info) bci-fetch-last-height Fetch the last block height using blockchain.info. bci-history Get list of output points, values, and their spends from blockchain.info
MISC btc Convert Satoshis into Bitcoins. initchain Initialize a new blockchain. qrcode Generate Bitcoin QR codes offline. satoshi Convert Bitcoins into Satoshis. sha256 Perform SHA256 hash of data. showblkhead Show the details of a block header. wallet Experimental command line wallet.
MULTISIG ADDRESSES scripthash Create BIP 16 script hash address from raw script hex.
LOOSE KEYS AND ADDRESSES addr See Bitcoin address of a public or private key. get-pubkey Get the pubkey of an address if available newkey Create a new private key. pubkey See the public part of a private key. secret-to-wif Convert a secret exponent value to Wallet. Import. Format. wif-to-secret Convert a Wallet. Import. Format to secret exponent value.
STEALTH stealth-addr See a stealth address from given input. stealth-initiate Initiate a new stealth payment. stealth-newkey Generate new stealth keys and an address. stealth-show-addr Show details for a stealth address. stealth-uncover Uncover a stealth address. stealth-uncover-secret Uncover a stealth secret.
EC MATH ec-add-modp Calculate the result of INTEGER + INTEGER. ec-multiply Multiply an integer and a point together. ec-tweak-add Calculate the result of POINT + INTEGER * G.
VALIDATE validsig Validate a transaction input's signature.
BLOCKCHAIN QUERIES balance Show balance of a Bitcoin address in satoshis. fetch-block-header Fetch raw block header. fetch-last-height Fetch the last block height. fetch-stealth Fetch a stealth information using a network connection to make requests against the obelisk load balancer backend. fetch-transaction Fetch a raw transaction using a network connection to make requests against the obelisk load balancer backend. fetch-transaction-index Fetch block height and index in block of transaction. get-utxo Get enough unspent transaction outputs from a given set of addresses to pay a given number of satoshis history Get list of output points, values, and their spends for an address. grep can filter for just unspent outputs which can be fed into mktx. validtx Validate a transaction.
BLOCKCHAIN UPDATES sendtx-bci Send tx to blockchain.info/pushtx. sendtx-node Send transaction to a single node. sendtx-obelisk Send tx to obelisk server. sendtx-p2p Send tx to bitcoin network.
HD KEYS hd-priv Create an private HD key from another HD private key. hd-pub Create an HD public key from another HD private or public key. hd-seed Create a random new HD key. hd-to-address Convert an HD public or private key to a Bitcoin address. hd-to-wif Convert an HD private key to a WIF private key.
See 'sx help COMMAND' for more information on a specific command.
SpesmiloXchange home page: <http://sx.dyne.org/>
Install globally: $ wget https://sx.dyne.org/install-sx.sh $ sudo bash install-sx.sh
Install locally (non-root): $ wget https://sx.dyne.org/install-sx.sh $ bash install-sx.sh usr/
|
|
|
Hey, I'm really interested in this and have been building some things already: https://bitcointalk.org/index.php?topic=50721.0I believe that if we give good nice modular tools to admins that they can chain together in bash scripts, then that's helping diversify Bitcoin development. At the moment I'm just stuck on designing the interface (what arguments, commands and switches look like. what does what), and am soliciting feedback if anyone has any ideas. I already have some cool possibilities. On the backend, I have a load balancer with several workers (full Bitcoin nodes) that you can make blockchain queries against for scalability and redundancy, and subscribe to new confirmed blocks and validated unconfirmed transactions. It's all asynchronous. https://github.com/genjix/obeliskI want to make a lite non-persistent wallet, some building blocks, Linux admin tools, secure backend for website balances. For managing keys, I have a toolset for Linux where you can do stuff like offline transactions for safely managing Bitcoins in cold storage with a trained admin. Here's an example of the fullnode (300 LOC) in C++, Python (bindings) and C (wrapper). http://libbitcoin.dyne.org/doc/examples/fullnode.html#examples-fullnodehttps://gitorious.org/libbitcoin-bindings/libbitcoin-bindings/blobs/master/tests/fullnode.pyhttps://github.com/genjix/libbitcoin-c-wrapper/blob/master/examples/fullnode.cMy email is on my website: http://libbitcoin.dyne.org/
|
|
|
Lol, I've spent the last 2 years living solely on Cryptos. Although, my expenses aren't very high. I want an article So you spent the last 2 years: - Not paying taxes? Don't worry, this is only a felony.
- Without filling up the tank? No problem. Live in Manhattan.
- Eating only Foodler (junk food)? Must be American, I guess.
- With no visits to the hospital? Some just never get sick.
- Neglecting rent/property tax? Or, you know, live on the streets.
I find your statement incredibly hard to believe, unless you live in a slum in Somalia. I don't earn enough to pay taxes. I can't drive (live in europe). I skip food (see http://trashwiki.org/en/Main_Page ). Hospital is free here. I squat and don't pay rent. Plenty of other options for living too. Many people are living off Bitcoins now. It's quite common
|
|
|
Not all forum members have enough posts to be able to PM the OP. Consider adding an additional contact method for those people.
|
|
|
mtgox, bitpay, coinlab, bitinstant = money transmitter companies = bitcoin foundation
|
|
|
I see what you're saying but it does feel a bit depressing if the unscrupulous keep exploiting people and do well off it. I'm hoping Bitcoin will empower more people. Most people are good.
|
|
|
Don't be so harsh on him. Stephen Foley (the author) is an old guy that doesn't like Bitcoin. He thinks it's stupid and doesn't get it. I'm sure Jonathan probably said more but he got quoted out of context.
|
|
|
Tre teda. Bonvolu diri pri ion alia ol Esperanto-gramatiko. Tiu versxajnas la sola temo pri kiun esperantistoj diskutas.
|
|
|
|