{"Import and Export": [{"id": 4, "title": "How to import labels from my wallet into Labelbase?", "content": "### How to import labels from my wallet into Labelbase?\r\n\r\nTo import data from various wallet's export format into Labelbase and then export it as BIP-329 labels, you would need to follow these steps:\r\n\r\n1. **Export data from your wallet:** The first step is to export your data from your wallet. The format of this export will depend on the wallet you are using, but it may include private keys, public keys, or other information.\r\n\r\n2. **Import data into Labelbase:** Next, you'll need to import the exported data into Labelbase. You can do this by using the import feature within your Labelbase. Choose the appropriate option based on the file format you want to import.\r\n Even though we do not store your uploaded files, **DO NOT UPLOAD ANY PRIVATE KEY MATERIAL TO LABELBASE.**\r\n\r\n3. **Modify and edit labels:** Once your labels are imported into Labelbase, you can modify and edit your labels as needed. This may include changing the names of your addresses, grouping them into different categories, or adding additional information.\r\n\r\n4. **Export as BIP-329 labels:** Finally, you'll need to export your labels from Labelbase as BIP-329 labels. This will typically involve downloading a file in the BIP-329 format, which you can then import into your wallet.\r\n\r\n5. **Use Labelbase through the API:** Alternatively, you can use Labelbase through the API in your wallet. This will allow you to access your labels directly from within your wallet, without the need to export and import files. To do this, your wallet needs to integrate the Labelbase API into the wallet.", "order": 0, "category_id": 6, "slug": "from-wallet-to-labelbase", "exclude_from_export": false}, {"id": 5, "title": "How is the encrypted label file generated, and how can I decrypt it?", "content": "### How is the encrypted label file generated, and how can I decrypt it?\r\n\r\n- The encrypted label file is generated using the [Labelbase Python library for BIP-329](https://github.com/Labelbase/python-bip329). This library provides functionality for managing Bitcoin coin control information and allows you to export labels in an encrypted format.\r\n\r\n- To decrypt the BIP-329 label files manually, you can refer to [the instructions provided](https://github.com/Labelbase/python-bip329#decrypting-bip-329-label-files) in the Labelbase Python library documentation. This documentation provides detailed steps and examples for decrypting label files using the library.\r\n\r\n- Please note that the passphrase used for encryption is crucial for decryption. Ensure that you keep your passphrase secure and do not share it with anyone unauthorized, as it is required to access your encrypted label data.", "order": 0, "category_id": 6, "slug": "encrypted-label-export", "exclude_from_export": false}], "Fix and Manage": [], "Hashtags": [{"id": 9, "title": "Enable or disable Hashtags", "content": "Enable or disable hashtag parsing and its associated functions in your profile settings", "order": 0, "category_id": 8, "slug": "enable-or-disable-hashtags", "exclude_from_export": false}], "Understanding and utilizing labels": [], "Labelbase API": [{"id": 6, "title": "Integrating the Labelbase API: A Step-by-Step Python Guide", "content": "# Integrating the Labelbase API: A Step-by-Step Python Guide\r\nWelcome to the Labelbase API integration Python tutorial! In this guide, we'll walk you through the process of seamlessly integrating the Labelbase API into your project. The Labelbase API allows you to manage labelbases and labels, making it an invaluable tool for organizing and syncing your BIP-329 Bitcoin labels and coin information.\r\n\r\n\r\n\r\n\r\nBelow is a step-by-step guide that walks you through the process of using the Labelbase API to manage labelbases and labels. I've included explanations, code snippets, and comments to assist you in understanding each step.\r\n\r\nPlease note that you need to replace 'your_key_here' with [your actual API key](/account/apikey/).\r\n\r\n\r\n\r\n```\r\n# Import required libraries\r\nimport requests # pip install requests\r\nimport json\r\n\r\n# Replace 'your_key_here' with your actual API key\r\napi_key = 'your_key_here'\r\n\r\n# Define the base URL for the Labelbase API\r\nbase_url = 'https://labelbase.space/api/v0/'\r\n\r\n# Define headers containing the API key\r\nheaders = {\r\n 'Authorization': f'Token {api_key}' # Authentication scheme is 'Token' not 'Bearer' or 'JWT'\r\n}\r\n```\r\n\r\n\r\n```\r\n# Create a new Labelbase\r\nurl = f'{base_url}labelbase/'\r\ndata = {\r\n 'name': 'Bitcoin Chronicles',\r\n 'fingerprint': 'ticktock',\r\n 'about': 'Legendary transactions and important addresses.'\r\n}\r\nresponse = requests.post(url, headers=headers, data=data)\r\nlabelbase_id = json.loads(response.text).get('id')\r\n\r\nprint(f'Created Labelbase with ID: {labelbase_id}')\r\n```\r\n\r\n\r\n\r\n**First Bitcoin Transaction:** On January 12, 2009, the first known Bitcoin transaction took place between Satoshi Nakamoto (the pseudonymous creator of Bitcoin) and Hal Finney. Nakamoto sent 10 BTC to Finney as a test.\r\n\r\n```\r\n# Create two labels within the created Labelbase\r\nurl = f'{base_url}labelbase/{labelbase_id}/label/'\r\n\r\ndata = {\r\n 'type': 'tx',\r\n 'ref': 'F4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16',\r\n 'label': 'Satoshi sending sats'\r\n}\r\n\r\nresponse = requests.post(url, headers=headers, data=data)\r\nprint(json.loads(response.text))\r\nlabel_id = json.loads(response.text).get('id')\r\nprint(f'Created Label with ID: {label_id}')\r\n```\r\n\r\n\r\n**Pizza Purchase:** On May 22, 2010, a programmer named Laszlo Hanyecz famously paid 10,000 BTC (worth millions of dollars today) for two pizzas, making it one of the earliest examples of a real-world transaction using Bitcoin.\r\n\r\n```\r\ndata = {\r\n 'type': 'tx',\r\n 'ref': 'Cca7507897abc89628f450e8b1e0c6fca4ec3f7b34cccf55f3f531c659ff4d79',\r\n 'label': 'Two supreme pizzas from Papa John\\'s'\r\n}\r\n\r\nresponse = requests.post(url, headers=headers, data=data)\r\nprint(json.loads(response.text))\r\nlabel_id = json.loads(response.text).get('id')\r\nprint(f'Created Label with ID: {label_id}')\r\n```\r\n\r\n\r\n```\r\n# List all labels within a Labelbase\r\nurl = f'{base_url}labelbase/{labelbase_id}/label/'\r\nresponse = requests.get(url, headers=headers)\r\nlabels = json.loads(response.text)\r\n\r\nprint('Labels within the Labelbase with ID {labelbase_id}:')\r\nfor label in labels:\r\n print(label)\r\n\r\n```\r\n\r\n\r\n\r\nTo perform label updates, you have two options.\r\nYou can either provide the label ID along with the updated data, or you can retrieve the existing label data using a known ID, modify the relevant JSON fields, and then send the modified data. Keep in mind that in the latter approach, you should replace 'your_satoshi_label_id' with the specific label ID you are working with.\r\n\r\n```\r\n# Update a label within a Labelbase\r\n\r\n# V1\r\ndata = {\r\n 'type': 'tx',\r\n 'ref': 'F4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16',\r\n 'label': 'First transaction from Satoshi to Hal Finney'\r\n}\r\n\r\nlabel_id = 'your_satoshi_label_id'\r\nurl = f'{base_url}labelbase/{labelbase_id}/label/{label_id}/'\r\nresponse = requests.put(url, headers=headers, data=data)\r\nprint(json.loads(response.text))\r\nlabel_id = json.loads(response.text).get('id')\r\nprint(f'V1) Updated Label with ID: {label_id}')\r\n```\r\n\r\n\r\n```\r\n# V2\r\nfor label in labels:\r\n if label.get('id') == 'your_satoshi_label_id':\r\n data = label\r\n\r\nassert data\r\ndata['label'] = 'First transaction from Satoshi to Hal Finney'\r\nlabel_id = data.get('id')\r\n\r\nurl = f'{base_url}labelbase/{labelbase_id}/label/{label_id}/'\r\nresponse = requests.put(url, headers=headers, data=data)\r\nprint(json.loads(response.text))\r\nlabel_id = json.loads(response.text).get('id')\r\nprint(f'V2) Updated Label with ID: {label_id}')\r\n```\r\n\r\n\r\n```\r\n# Delete a label within a Labelbase\r\nurl = f'{base_url}labelbase/{labelbase_id}/label/{label_id}/'\r\nresponse = requests.delete(url, headers=headers, data={})\r\nprint(f'Deleted Label with ID: {label_id}')\r\n```", "order": 0, "category_id": 10, "slug": "step-by-step-python-api-guide", "exclude_from_export": false}], "Self-Hosted Labelbase": [{"id": 7, "title": "Creation of a Superuser", "content": "## Creation of a Superuser\r\n\r\n\r\nThe first user created on the instance will be automatically created as superuser.\r\n\r\nThe superuser can import and export the knowledge base.\r\n\r\nA superuser can't access others' data through the admin interface.", "order": 0, "category_id": 13, "slug": "fist-user-is-superuser", "exclude_from_export": false}, {"id": 8, "title": "Labelbase Dockerized Installation Guide", "content": "## Labelbase Dockerized Installation Guide \r\n\r\nThis guide [https://github.com/Labelbase/Labelbase/blob/master/install.md](https://github.com/Labelbase/Labelbase/blob/master/install.md) provides instructions on installing and running Labelbase using Docker on your local machine or server.", "order": 0, "category_id": 13, "slug": "dockerized-installation-guide", "exclude_from_export": false}, {"id": 10, "title": "Backups", "content": "## Backups\r\nBefore upgrading to a newer version, backup your data by exporting your labels as a BIP-329 file or an encrypted archive.", "order": 0, "category_id": 13, "slug": "backups", "exclude_from_export": false}]}