Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - akashic

Pages: [1]
1
In looking at the following code:

Code: [Select]
from pprint import pprint
from bitshares import BitShares

testnet = BitShares(
    "wss://node.testnet.bitshares.eu",
    nobroadcast=True,
    bundle=True,
)

testnet.wallet.unlock("supersecret")

testnet.transfer("init0", 1, "TEST", account="xeroc")
testnet.transfer("init1", 1, "TEST", account="xeroc")
testnet.transfer("init2", 1, "TEST", account="xeroc")
testnet.transfer("init3", 1, "TEST", account="xeroc")

pprint(testnet.broadcast())

We see that assets are transferred from the account xeroc to init0, init1, init2, and init3.

My questions are:
  • was the wallet created using code similar to this: http://docs.pybitshares.com/en/latest/index.html#create-a-wallet  ... how else might it have been created?
  • Does a private key need to be added for that wallet
  • What is the relationship between the account "xeroc" and the wallet that was created?
  • Are the terms "wallet" and "account" official Bitshares terminology? Where are they defined

2
Technical Support / pybitshares: "You already have created a wallet!"
« on: June 15, 2018, 09:54:16 pm »
I (naively) ran the code in the prologue of the pybitshares docs:

Code: [Select]
from bitshares import BitShares
bitshares = BitShares()
bitshares.wallet.create("secret-passphrase")
bitshares.wallet.addPrivateKey("<wif-key>")

And after being unable to unlock the wallet for a transfer:

Code: [Select]
from bitshares import BitShares
bitshares = BitShares()
bitshares.wallet.unlock("wallet-passphrase")
bitshares.transfer("<to>", "<amount>", "<asset>", "[<memo>]", account="<from>")

I found  a website that converts to and from WIF keys (http://gobittest.appspot.com/PrivateKey) and (naively) used that to create a wallet (unaware of this information on how to create a real wallet and add a WIF key given here - https://bitsharestalk.org/index.php?topic=26177.0).

So, now I am stuck with having created a wallet that is not truly on the bitshares blockchain.

I would like to completely erase the wallet I (naively) created.
Code: [Select]
pip uninstall bitshares ; pip install bitshares did not get rid of the wallet I created but can no longer get in.
I would like to instead run the wallet creation code with the wallet I just created. There is a small problem though: when I went to wallet.bitshares.org to create the wallet, it seems that it was created as a sub-account of "floatation8" not as a full-account. The reason I say that is that the account I created (adsactlybot8) has no password - at no point in the account creation process was I prompted to enter a password for the new account. This I do not see how wallet.create('secret-passphrase') would work: is this passphrase supposed to be the same as the one when the wallet was created or a new one?

3
Hello, I would like to get the following example from the PyBitshares documentation [1] to work:

Code: [Select]
   
    from bitshares import BitShares
    bitshares = BitShares()
    bitshares.wallet.unlock("wallet-passphrase")
    bitshares.transfer("<to>", "<amount>", "<asset>", "[<memo>]",
                        account="<from>")

Although this is not the meat of my problem, you cannot supply keyword parameters after positional parameters. Therefore the call to
Code: [Select]
.transfer() cannot have
Code: [Select]
account=<from> parameter at the end.

Anyway, moving on to the real issues, it seems that before you can get this example to work, you need to decide on a wallet operation model (Wallet Database, Provide Keys, Force Keys). For this discussion, I would like to focus on providing keys.

The Bitshares constructor [2] accepts a `keys` parameter whose value may be an array, dictionary or string. This leads to the following questions:

1 - what is a wif key? What does "wif" stand for?
2 - Where would I access the private key for an OpenLedger account? Please provide a precise navigation sequence.
3 - Where would I access the private key for a Crypto-Bridge account? Please provide a precise navigation sequence.
4 - Once I find the private key how does one supply it? The docs state the types of things that the `keys` parameter accepts, but it does not show how to supply it.

After looking at the wallet documentation [3] I have a few more questions:

1 - after adding a private key, does PyBitshares automatically know which Bitshares account it belongs to? For instance, if I add the private keys for the the bitshares user bev123 [4] am I able to call getActiveKeyForAccount [5] and supply 'bev123' as the name of the account?

[1] http://docs.pybitshares.com/en/latest/index.html
[2] http://docs.pybitshares.com/en/latest/bitshares.bitshares.html
[3] http://docs.pybitshares.com/en/latest/bitshares.wallet.html
[4] https://cryptofresh.com/u/bev123
[5] http://docs.pybitshares.com/en/latest/bitshares.wallet.html#bitshares.wallet.Wallet.getActiveKey

Pages: [1]