edgecase
Author: StJohn Piano
This page is subject to change at any time. It is not signed by its author or by Edgecase Datafeed.



Introduction


A transaction is a signed note that describes the transfer of bitcoin from one or more input addresses to one or more output addresses. It must be digitally signed by the private key for each input address.

Transactions can be thought of as digitally signed patches that alter the state of the Bitcoin public ledger.

Signing a transaction requires the use of private keys, so signatures should only be made on an offline computer.

Currently, Edgecase software only supports Bitcoin transactions that contain a single input and a single output.




Contents


- Introduction
- Contents
- Generating entropy for use in signing transactions
- Choosing a fee for a transaction
- Standard transactions
- Nonstandard transactions
- Broadcasting a transaction
- More information




Generating entropy for use in signing transactions


A transaction signature requires 32 bytes of entropy. The entropy used for the signature should be generated with the same care as that which was used to generate entropy for creating a private key.

To learn how to generate entropy for a signature, please go to the following page:
How to create a Bitcoin private key
Following the recipe for creating a private key will produce 32 bytes of entropy, which can then be used for making a signature instead.

If you would like to generate a large amount of entropy in one session, follow the same recipe, but choose a different desired number of bytes of entropy. Generate this number of entropy bytes, then use the following approach to divide the entropy into pieces:
- Browse to the article Using a transaction to validate a Bitcoin address. Go to the Notes section. Read the part "Using Python slicing to divide entropy bytes into pieces with particular lengths".




Choosing a fee for a transaction


You should look up the range of fee rates for transactions that are currently being mined. Choose a high fee rate if you want your transaction to be mined quickly. Choose a low fee rate if the bitcoin transfer is not urgent.

Please see the following page:
Other services
to see if a Bitcoin fee analysis service is listed.




Standard transactions


Edgecase's working definition of a standard transaction:
- It has at least one input and at least one output.
- All input and output addresses are Pay-To-Public-Key-Hash (P2PKH).
- All input scriptSigs contain uncompressed public keys.

You should store your bitcoin in standard addresses and use standard transactions to transfer bitcoin between them or to send bitcoin to another person.

Currently, Edgecase software only supports standard Bitcoin transactions that contain a single standard input and a single standard output.

Please go to the following page to learn how to create and sign a standard Bitcoin transaction:
How to create and sign a standard Bitcoin transaction




Nonstandard transactions


Edgecase's working definition of a nonstandard transaction:
- It has at least one input and at least one output.
- At least one input or output address is not a standard Pay-To-Public-Key-Hash (P2PKH) address.

Some Bitcoin exchanges will give you a P2SH address at which you can receive a payment to your exchange account. In order to transfer bitcoin from long-term storage to one of these exchanges, you will need to construct a nonstandard transaction that sends bitcoin to your P2SH receiving address.

Currently, Edgecase software only supports nonstandard Bitcoin transactions that contain a single standard input and a single nonstandard Pay-To-Script-Hash (P2SH) output.

Please go to the following page to learn how to create and sign a nonstandard Bitcoin transaction:
How to create and sign a nonstandard Bitcoin transaction




Broadcasting a transaction


Please see the following page:
Other services
to see if a Bitcoin transaction broadcast service is listed.

If your transaction is not mined within a desired period, you should create a new version with a higher fee. Some reading indicates that Bitcoin nodes will delete an unconfirmed transaction from their memory pools after a particular time period, the default value of which is 72 hours (three days).

Please see the following page:
Other services
to see if a Bitcoin transaction confirmation tracking service is listed.

You should wait until the transaction has been mined (included in a new block) and a further 5 blocks have been mined afterwards. The end of the blockchain is somewhat mutable, but a block becomes increasingly immutable as it moves further back into the chain.

Any valid signed transaction can be stored and rebroadcast by any other party, so any new version must invalidate the old version of the transaction.

Please read the following item to learn how to safely manage making a new version of your transaction:
- Browse to the article Creating and signing a standard raw Bitcoin transaction. Read the section Recipe For Managing The Fee And Broadcast Of A Bitcoin Transaction.




More information


Strictly speaking, an address does not hold a particular bitcoin value. It holds one or more "unspent outputs", which are outputs from previous transactions that were sent to the address. These outputs hold particular values. The sum of these values is the amount of bitcoin held in the address. These values are actually stored in satoshi, which is the smallest unit of currency in the Bitcoin system. 10^8 satoshi are equivalent to 1 bitcoin.

Each input can only ever be spent once and must be spent completely. You can choose to spend only a portion of an input by sending some of its bitcoin value to an address that you control, known as a "change address". The change address could be the original address, if you wish.

You may need to send an amount of bitcoin to an output address that is greater than the amount stored in any single available input. If so, you will need to use multiple available inputs, which must sum to at least the desired amount. Any change can be sent to a change address.

For more information concerning Bitcoin transactions:

- Browse to the article Reading and verifying a standard raw bitcoin transaction. Read the Thoughts section.

- Browse to the article Reading and verifying a standard raw bitcoin transaction. Read the Notes / Discoveries section.

- Browse to the article Creating and signing a standard raw Bitcoin transaction. Go to the Notes / Discoveries section. Read the following parts:
-- Standard transaction - raw format
-- Standard transaction-in-signable-form - raw format
-- Gathering data in order to construct a new transaction
-- Algorithm for signing a standard transaction
-- Transaction Malleability
-- BIP 62 - Dealing with malleability
-- High and low S values in Bitcoin transaction signatures
-- Further information concerning ECDSA signatures and S values
-- Transactions constructed and signed in this project
-- Transaction identifier (txid) construction and endianness
-- Endianness
-- Proposal for a unique transaction identifier (utxid)

- Browse to the article Creating and signing a standard raw Bitcoin transaction. Read the Further Work section.

- Browse to the article Creating and signing a standard raw Bitcoin transaction: Iteration #2. Go to the Notes section. Read the following parts:
-- Definitions and acryonyms
-- Gathering data in order to construct a new transaction using the scripts created in this project

- Browse to the article Creating and signing a standard raw Bitcoin transaction: Iteration #2. Read the Further Work section.