create account

Creating Claimed Hive Accounts Using Beem by geekgirl

View this thread on: hive.blogpeakd.comecency.com
· @geekgirl ·
$58.26
Creating Claimed Hive Accounts Using Beem
<center>![hive.png](https://images.hive.blog/DQmTKECzrZ8pUTATekYvb5Hefff41FNZSMdcEHwhgsYG8PT/hive.png)</center>

In my previous post I wrote about claiming discounted Hive accounts using Beem in python. Today, I would like to share how to create new Hive accounts using claimed account tokens. I used @holger80's older guide that was written for Steem, and repurposed for creating claimed accounts on Hive.

I decided to try this, just out of curiosity to see how account creation works, but also wanted to create myself a separate account for a tribe. I have seen many people using separate accounts for curating purposes for tribes. I am not sure if I will do the same yet, but thought it is a good reason to create one as an experiment. For this example I will be creating a new account called **geekleo**, which potentially may become my account to hold leo power. 

In the future I would like to be able to integrate account creation feature in one of my apps, so I can also contribute onboarding new users to Hive. For that I will need to gain more skills and knowledge on how to do it properly and securely. 

While writing the code, I have couple questions in mind. One of them was what happens if I try to create an existing account, which I tried to do. Beem throws an exception with an error message **account already exists**. Alternatively, I was thinking to add HiveSQL code to check if chosen new account name already exists. 

Along with providing new account name, we also need to provide a password which will serve as seed password to generate other account keys. After account was created the result of the transaction only returned public keys along with other information. It didn't return the private keys. 

I am not sure if there a way to get the private keys within python code in Beem yet. If you know how to do that please let me know. 

After the account was created, I tried to login on Hive.blog and it gave me the message saying I was trying to login with a non-posting key and offered to download my private keys as pdf. That was nice. I downloaded the file and it showed me all of the private keys.

Message from Hive.blog login page:

<center>![login.jpeg](https://images.hive.blog/DQmXUD4Hjqhh7faiV6dVd5dAduRCBY1NF3Z5BZz7qpjmjyY/login.jpeg)</center>

I still need to figure out how to obtain private keys without relying on other front ends.

Following is the full code to create claimed account:

```
from beem import Hive
from beem.nodelist import NodeList
from beem.account import Account
from beem.rc import RC
import pprint
import getpass
import time

if __name__ == "__main__":

    new_account_name = 'geekleo'
    new_account_pass = 'XXXXXXXXXXXXXXXXXXXXXXXXX'

    #if account already exists, throws account exists exception.

    nodelist = NodeList()
    nodelist.update_nodes()
    nodes = nodelist.get_hive_nodes()

    wif = getpass.getpass(prompt="Enter your account creator's Hive active key:")
    hive = Hive(node=nodes, keys=[wif])

    creator = hive.wallet.getAccountFromPrivateKey(wif)
    creator = Account(creator)

    result = hive.create_claimed_account(new_account_name, creator=creator, password=new_account_pass)
    print(result)

    time.sleep(10)

    new_account = Account(new_account_name)
    new_account.print_info()
    
```

I wrote in the new account name and the seed password variables within the code. The way Holder did it was by giving an option to pass the new account name as an argument, then asking for the password and password confirmation in the terminal (command prompt). I did this just for simplicity purposes. Everything else is self-explanatory. The main method that creates the account is `.create_claimed_accounts()` which takes new account name, account creator name and password as parameters. 

I believe this will only work with claimed accounts. There must be another method for creating accounts by paying in Hive, which I have not tried yet. Creating new accounts currently costs 3 Hive.





Posted Using [LeoFinance <sup>Beta</sup>](https://leofinance.io/@geekgirl/creating-claimed-hive-accounts-using-beem)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 182 others
👎  
properties (23)
authorgeekgirl
permlinkcreating-claimed-hive-accounts-using-beem
categoryhive-167922
json_metadata{"app":"leofinance/0.2","format":"markdown","tags":["python","hive","beem","dev","coding","stem","ctp","neoxian","palnet","blog","leofinance"],"canonical_url":"https://leofinance.io/@geekgirl/creating-claimed-hive-accounts-using-beem","image":["https://images.hive.blog/DQmTKECzrZ8pUTATekYvb5Hefff41FNZSMdcEHwhgsYG8PT/hive.png","https://images.hive.blog/DQmXUD4Hjqhh7faiV6dVd5dAduRCBY1NF3Z5BZz7qpjmjyY/login.jpeg"]}
created2021-04-09 05:28:09
last_update2021-04-09 05:28:09
depth0
children2
last_payout2021-04-16 05:28:09
cashout_time1969-12-31 23:59:59
total_payout_value31.956 HBD
curator_payout_value26.302 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,112
author_reputation1,586,488,611,824,452
root_title"Creating Claimed Hive Accounts Using Beem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id102,923,136
net_rshares61,083,425,016,819
author_curate_reward""
vote details (247)
@bozz ·
$0.24
Very cool.  I usually just use the thing that is built into PeakD, but that is creating new accounts I think.  Not ones that have already been claim.  Very impressive what you have done here!

Posted Using [LeoFinance <sup>Beta</sup>](https://leofinance.io/@bozz/re-geekgirl-47g9hk)
👍  
properties (23)
authorbozz
permlinkre-geekgirl-47g9hk
categoryhive-167922
json_metadata{"app":"leofinance/0.2","format":"markdown","tags":["hive-167922","leofinance"],"canonical_url":"https://leofinance.io/@bozz/re-geekgirl-47g9hk"}
created2021-04-09 11:32:12
last_update2021-04-09 11:32:12
depth1
children0
last_payout2021-04-16 11:32:12
cashout_time1969-12-31 23:59:59
total_payout_value0.118 HBD
curator_payout_value0.119 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length282
author_reputation2,228,665,208,238,642
root_title"Creating Claimed Hive Accounts Using Beem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id102,928,103
net_rshares409,065,188,725
author_curate_reward""
vote details (1)
@poshbot ·
https://twitter.com/geekjen/status/1380392942259499014
properties (22)
authorposhbot
permlinkre-creating-claimed-hive-accounts-using-beem-20210409t053203z
categoryhive-167922
json_metadata"{"app": "beem/0.24.20"}"
created2021-04-09 05:32:03
last_update2021-04-09 05:32:03
depth1
children0
last_payout2021-04-16 05:32:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length54
author_reputation5,554,335,374,496
root_title"Creating Claimed Hive Accounts Using Beem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id102,923,187
net_rshares0