Coder Social home page Coder Social logo

btcwallet's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btcwallet's Issues

btcwallet should write emtpy tx.bin and utxo.bin files

On initial startup (with a new, empty wallet), btcwallet gives the following errors:
10:41:48 2014-01-08 [ERR] BTCW: cannot open tx file: open /home/john/.btcwallet/mainnet/tx.bin: no such file or directory
10:41:48 2014-01-08 [ERR] BTCW: cannot open utxo file: open /home/john/.btcwallet/mainnet/utxo.bin: no such file or directory

Those files should not be there initially, so rather than an error, btcwallet should just write the empty files.

Implement better private key import RPC extension.

The standard RPC call for importing private keys, importprivkey, has a number of issues. Namely:

  1. The command does not allow specifying any hints as to when an address first appeard, either by date or blockchain height. This can result in unnecessarily long rescans.
  2. As a rescan is triggered for each import, and importprivkey has no way of importing multiple private keys at once, this ends up triggering multiple rescans.

An extension RPC command should be added which resolves these issues.

Wallet sync fails upon createencryptedwallet

Fired {"id":"createencryptedwallet", "method":"createencryptedwallet", "params": ["testwallet", "bananas", "testpassphrase"] }, but btcwallet keeps giving the following output:

[ERR] BTCW: cannot sync dirty wallet: open /Users/alexanderhanhikoski/Library/Application Support/Btcwallet/btcwallet-testwallet/wallet.bin-1384986032: no such file or directory

Once I created btcwallet-testwallet directory, it was able to sync.

support dumpprivkey

support dumpprivkey for paper backups and importing into bitcoind if need be.

!hardcode localhost

currently the port but not the host can be configured

I understand this will get looked at after the tls bits are in place to secure connections to other hosts

create wallet prompt is not persistent

using btcgui to connect to a new btcwallet, it correctly prompts for a passphrase to create a new wallet.

However, if you kill btcgui and reconnect before doing so, it doesn't prompt again until you restart btcwallet.

Be less dependent on sync.Mutex

Currently, the account type relies on sync.Mutex for correct concurrent access to the wallet, utxo, and tx structures. This should be changed to use a Go channel to serialize requests to access and modify the structures.

Support pay-to-pubkey notifications

Currently the registered notifications only support pay-to-pubkey-hash. Support for detecting compressed and uncompressed keys still needs to be added.

visually diffrentiate networks

btcwallet doesn't make it obvious which network it is running on. bitcoin-qt shows [testnet] in the title bar and uses a different color icon. It would be good if btcgui also did some really obvious things to make this clear.

doesn't support unix homedir expansion

Before:

$ btcwallet --cafile=~/.btcd/rpc.cert -d=debug
08:25:43 2013-11-21 [ERR] BTCW: cannot open CA file: open ~/.btcd/rpc.cert: no such file or directory

After:

$ ./btcwallet --cafile=~/.btcd/rpc.cert
08:26:01 2013-11-21 [INF] BTCW: RPCS: RPC server listening on 127.0.0.1:18332
08:26:01 2013-11-21 [INF] BTCW: RPCS: RPC server listening on [::1]:18332
08:26:02 2013-11-21 [INF] BTCW: Established connection to btcd.

Repetitive error after launching btcdsuite

After launching btcdsuite, the following error messages appear in the btcws console window on Win7x64:

02:33:28 2013-12-05 [ERR] BTCW: cannot open utxo file: open C:\Users\L\
AppData\Roaming\btcwallet\btcwallet\utxo.bin: The system cannot find the file sp
ecified.
02:33:29 2013-12-05 [INF] BTCW: Established connection to btcd.
02:33:37 2013-12-05 [ERR] BTCW: cannot sync dirty wallet: rename C:\Users\Lr\AppData\Roaming\btcwallet\btcwallet\wallet.bin-1386232417 C:\Users\L\AppData\Roaming\btcwallet\btcwallet\wallet.bin: Cannot create a file when tha
t file already exists.
02:33:48 2013-12-05 [ERR] BTCW: cannot sync dirty wallet: rename C:\Users\L\AppData\Roaming\btcwallet\btcwallet\wallet.bin-1386232428 C:\Users\L\AppData\Roaming\btcwallet\btcwallet\wallet.bin: Cannot create a file when tha
t file already exists.
02:33:58 2013-12-05 [ERR] BTCW: cannot sync dirty wallet: rename C:\Users\L\AppData\Roaming\btcwallet\btcwallet\wallet.bin-1386232438 C:\Users\L\AppData\Roaming\btcwallet\btcwallet\wallet.bin: Cannot create a file when tha
t file already exists.
02:34:08 2013-12-05 [ERR] BTCW: cannot sync dirty wallet: rename C:\Users\L\AppData\Roaming\btcwallet\btcwallet\wallet.bin-1386232448 C:\Users\L\AppData\Roaming\btcwallet\btcwallet\wallet.bin: Cannot create a file when tha
t file already exists.

And continues to appear until the program is terminated.

New addresses must immediately appear in frontends.

Currently, newly-requested addresses (such as through a getnewaddress request) and addresses created for transaction change do not appear immediately in frontends. Make this a notification so all frontends are aware of any new addresses.

multiple btcd server support

It would be nice to have multiple btcd server support for, at minimum, failover. You would need to specify multiple connection properties for each server, (ip, port, user, pass, certificate). Upon disconnect, btcwallet would cycle through the list of servers until it has connected again.

Add extension to query transactions to or from select addresses.

In the case where a frontend must know details of transactions to or from either a single or group of addresses, rather than caring about details for all addresses in a wallet, with the standard API it must use a listtransactions request and filter out transactions that don't matter to it. An extension request should be added to handle this case. The extension should be generic enough to query btcwallet for all or a range of transactions to or from one or more addresses. Write an extension request which meets these requirements

Add getwork support

We have had a few requests for miner support. Please add support for getwork.

Starting btcwallet with default instructions fails

Installed btcd and btcwallet according to the instuctions. Trying to run btcwallet results in:

18:38:14 2013-11-20 [ERR] BTCW: cannot open wallet: wallet file does not exist
18:38:14 2013-11-20 [ERR] BTCW: cannot open CA file: open /Users/alexanderhanhikoski/Library/Application Support/Btcwallet/cert.pem: no such file or directory

/Library/Application Support/Btcwallet/btcwallet/ is empty. Is btcwallet failing to create a default empty wallet or should this be done explicitly by the user? How?

Only provide frontends with data they ask for (at least as an option)

Currently, when you connect to btcwallet with a websocket as a frontend, it sends the info btcgui wants (account info) and then keeps sending blockheight as that changes. It would be nice if the frontend actually had some say in the info it recieved rather than always being spammed with things it did not ask for.

Accounts/wallets sub-directories scaling issue

I know we are very early into the development and I apologize if this premature.

btcwallet creates a new wallet for each account into a new directory. The number of sub-directories is limited in *nix file systems (seems like under 50k). Quite a few services have over 50k accounts, so it's not very difficult to hit this limit.

Am I thinking about this the wrong way and is it advisable simply to use a single account/wallet for everything and handle accounts in the application layer?

GetReceivedByAddressCmd

GetReceivedByAddressCmd would be very helpful in wallet (I know all the standard commands will eventually be implemented, but I'd vote for this being one of the next ones to go in).

Implement better sendmany RPC extension.

The sendmany RPC command is great because it is flexible enough to create a single tx with multiple outputs, however the resulting tx may include a greater fee than the user is willing to pay. An extension RPC command should be added which takes the same parameters as the sendmany command, but instead of sending the raw tx to btcd to relay to the network, the rawtx and included fee should be returned to the caller. This will allow a frontend to present a user with a message of whether the included fee is acceptable or not, and if so, the returned raw tx may be sent.

Implement UTXO rescanning

Currently, and funds sent to a btcwallet addresses while wallet is not connected to a running btcd instance will miss the notification as the new block is processed. Rescanning must be used to catch up to a more recent btcd and save unspent transaction outputs from missed block notifications.

These are a couple things that must be done in btcwallet first before a proper rescan is implemented. Each address saved in the wallet has fields for when it was first created and last used. Additionally, btcwallet must save the last seen block to disk, so on a later open, all rescanning before that block can be avoided.

This change can also hugely benefit from btcd keeping a seperate store of all UTXOs at the current block height. If so, this smaller data set (bitcoind uses similar, and is currently ~200-300MB total) can be checked for any unspent transactions outputs to a btcwallet address, instead of querying the database for each transaction in each block that was missed. Before a proper redesign of rescan is implemented, this btcd design should be debated and used if chosen.

Fix logging output.

Logging output does not currently match btcd, causing issues with timestamps not being printed in a human readable format, and debugging output being printed when info should be the default level.

This code can be mostly copied as is from btcd.

Comment

In wallet.go is this comment:

    // This is a perfect example of YOLO crypto.  Armory claims this XORing
    // with the SHA256 hash of the pubkey is done to add extra entropy (why
    // you'd want to add entropy to a deterministic function, I don't know),
    // even though the pubkey is generated directly from the privkey.  In
    // terms of security or privacy, this is a complete waste of CPU cycles,
    // but we do the same because we want to keep compatibility with
    // Armory's chained address generation.

I think without the entropy you would be able to look at public keys on the blockchain and calculate the next deterministic public key, thus allows anyone to figure out that a chain of addresses (as long as they were used at least once, thereby revealing the public keys) belong to the same wallet. This is a privacy concern.

respond to importprivkey before rescan

btcwallet should respond to the importprivkey command before initiating a rescan request to btcd. this would stop the client, such as btcctl, from waiting for rescan to finish.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.