Yenpoint 1Sat Ordinals
A Python library for creating 1Sat Ordinals NFTs on the BSV blockchain.
Installation
pip install yenpoint_1satordinals
Usage
- Preparing Ordinal NFT outputs
Use the add_1sat_outputs function. You need three arguments, ordinal address, data, and change address.
ordinal_address: the destination address of inscribing 1 sat ordinal NFT
data: it can take text strings or your file path to the data that you want to inscribe.
change_address: the address to recieve your change ammount
An example of Inscribing texts
from yenpoint_1satordinals import add_1sat_outputs
from pathlib import Path
outputs = add_1sat_outputs(
ordinal_address="your_ordinal_address",
data="Hello, World!",
change_address="your_change_address"
)
or
An example of Inscribing data You should define the path to the file that you want to inscribe first
from yenpoint_1satordinals import add_1sat_outputs
data_path = Path("data/image1.jpeg")
outputs = add_1sat_outputs(
ordinal_address="1HZqesnTJK8HK4Uypvvt7FgHoBdosBvTiS",
data=data_path,
change_address="1MWLhxkoucmstD5VGLZeiaq5YMdDRMn9oS"
)
Preparing the Transaction
from bsv.transaction_input import TransactionInput
from bsv.transaction import Transaction
from bsv import PrivateKey
from bsv.script import P2PKH
# Here adding the code of creating ordinal outputs
tx_input = TransactionInput(
source_transaction=previous_tx,
source_txid=previous_tx.txid(),
source_output_index=previous_tx_vout,
unlocking_script_template=P2PKH().unlock(sender_private_key)
)
tx = Transaction([tx_input], outputs)
tx.fee()
tx.sign()
Example of customising the Transaction, adding an additional output
from bsv.transaction_input import TransactionInput
from bsv.transaction_output import TransactionOutput
from bsv.transaction import Transaction
from bsv import PrivateKey
from bsv.script import P2PKH
# Here adding the code of creating ordinal outputs
tx_input = TransactionInput(
source_transaction=previous_tx,
source_txid=previous_tx.txid(),
source_output_index=previous_tx_vout,
unlocking_script_template=P2PKH().unlock(sender_private_key)
)
Additional_output = TransactionOutput(
locking_script=P2PKH().lock("1QnWY1CWbWGeqobBBoxdZZ3DDeWUC2VLn"),
satoshis=33,
change=False
)
tx = Transaction([tx_input], outputs + [Additional_output])
tx.fee()
tx.sign()
Do you async & await for the transaction broadcast.
import asyncio
async def main():
try:
# All other codes
await tx.broadcast()
except Exception as e:
print(f"Error occurred: {str(e)}")
if __name__ == "__main__":
asyncio.run(main())
- It automaticaly creates an oridnal, fee, and change outputs.
- The fee of inscription is less than 0.1 cent, 998 satoshi. (The commarcial license for cheaper fee rate.)
- You also have to pay the mining fee for miners, 1 satoshi/ kb of data.
License
This library is available for individual use. For commercial use, including metadata, and parsing features, an Enterprise license is required. See LICENSE.md for details.
Metadata
Release files for yenpoint-1satordinals 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yenpoint_1satordinals-0.1.1.tar.gz | 8.5 kB | Without provenance | Details for yenpoint_1satordinals-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yenpoint_1satordinals-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for yenpoint_1satordinals-0.1.1-py3-none-any.whl |
Total release size: 16.5 kB
Release files / yenpoint_1satordinals-0.1.1.tar.gz
| Download URL | yenpoint_1satordinals-0.1.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d121b51dc92b7bf86b8c455bad53a1520067d4711b0eb471994ed3a8f18acd1e
|
|
BLAKE2b-256 checksum How to use checksums |
f9bb6c38f7643f7aef19b2baeca29f4f927ddb1cb1666c3489237134f11679f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.3
|
Release files / yenpoint_1satordinals-0.1.1-py3-none-any.whl
| Download URL | yenpoint_1satordinals-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2af38dae6c5f8ee3f189c97c58116e9852a5c54bf56a6fb5e6485679c469d4ed
|
|
BLAKE2b-256 checksum How to use checksums |
ca04dfcc332799ebe3fa67fe9a2375183d4580b9bad666e6080eb671eddd3433
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.3
|
Security for yenpoint-1satordinals 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.