Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change slot notation to AxBxCxD #222

Merged
merged 4 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bip.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ A satpoint may be used to indicate the location of an ordinal within an output.

`680df1e4d43016571e504b0b142ee43c5c0b83398a97bdcfd94ea6f287322d22:0:6`

A slot may be used to indicate the output of an ordinal without referring to a transaction ID, by substituting the block height and transaction index within the block for the transaction ID. It is written as a dotted quad. For example, the ordinal at offset 100 in the output at offset 1, in the coinbase transaction of block 83 can be written as:
A slot may be used to indicate the output of an ordinal without referring to a transaction ID, by substituting the block height and transaction index within the block for the transaction ID. It is written as an x'ed quad, similar to a Lightning Network short channel ID with an additional number indicating the offset of the ordinal within the output. For example, the ordinal at offset 100 in the output at offset 1, in the coinbase transaction of block 83 can be written as:

`83.0.1.100`
`83x0x1x100`

Satoshis with ordinals that are not valuable or notable can be referred to as cardinal, as their identity does not matter, only the amount. A cardinal output is one whose ordinals are unimportant for the purpose at hand, for example an output used only to provide padding to avoid creating a transaction with an output below the dust limit.

Expand Down
12 changes: 6 additions & 6 deletions tests/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn first_satoshi() -> Result {
fn first_satoshi_slot() -> Result {
Test::new()?
.command("find 0 --slot")
.expected_stdout("0.0.0.0\n")
.expected_stdout("0x0x0x0\n")
.block()
.run()
}
Expand All @@ -33,7 +33,7 @@ fn second_satoshi() -> Result {
fn second_satoshi_slot() -> Result {
Test::new()?
.command("find 1 --slot")
.expected_stdout("0.0.0.1\n")
.expected_stdout("0x0x0x1\n")
.block()
.run()
}
Expand All @@ -53,7 +53,7 @@ fn first_satoshi_of_second_block() -> Result {
fn first_satoshi_of_second_block_slot() -> Result {
Test::new()?
.command("find 5000000000 --slot")
.expected_stdout("1.0.0.0\n")
.expected_stdout("1x0x0x0\n")
.block()
.block()
.run()
Expand All @@ -79,7 +79,7 @@ fn first_satoshi_spent_in_second_block() -> Result {
fn first_satoshi_spent_in_second_block_slot() -> Result {
Test::new()?
.command("find 0 --slot")
.expected_stdout("1.1.0.0\n")
.expected_stdout("1x1x0x0\n")
.block()
.block()
.transaction(TransactionOptions {
Expand All @@ -100,7 +100,7 @@ fn regression_empty_block_crash() -> Result {
include_coinbase_transaction: false,
..Default::default()
})
.expected_stdout("0.0.0.0\n")
.expected_stdout("0x0x0x0\n")
.run()
}

Expand All @@ -121,7 +121,7 @@ fn mining_and_spending_transaction_in_same_block() -> Result {
output_count: 1,
fee: 0,
})
.expected_stdout("1.2.0.0\n")
.expected_stdout("1x2x0x0\n")
.run()
}

Expand Down