Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
990bad7
create inscribe-chain cmd
felipelincoln May 18, 2023
32fe5f8
add parent
felipelincoln May 19, 2023
c3cb49b
create utxo splitter
felipelincoln May 19, 2023
040f824
add amount
felipelincoln May 19, 2023
6fd2571
improve error and fee rates
felipelincoln May 19, 2023
07ecc64
add docs and fix errors
felipelincoln May 20, 2023
44982ca
add req section
felipelincoln May 20, 2023
24b1e60
add mempool
felipelincoln May 20, 2023
47cec22
add mint guide
felipelincoln May 26, 2023
0777b91
make destination required
felipelincoln May 26, 2023
5462780
fix destination
felipelincoln May 26, 2023
3b2e47a
add ord5 and ord9 wip
felipelincoln May 26, 2023
8f23fa6
complete 300 mint guide
felipelincoln May 29, 2023
4300bd8
fix step numbers
felipelincoln May 29, 2023
c340c2e
use no backup
felipelincoln May 30, 2023
71c39d3
update 300-mint markdown
ericatallah May 31, 2023
03a036e
add inscription_satpoint logging
ericatallah May 31, 2023
8e07965
add self csp
ericatallah Jun 1, 2023
e1d59ee
add offset tx validation step
ericatallah Jun 1, 2023
06e3b0a
add is_brc_20 flag to logfile, update 300-mint.md
ericatallah Jun 2, 2023
33c7400
update 300 mint md
ericatallah Jun 5, 2023
ade3ac0
fix create-300 and add create-30 shell scripts
ericatallah Jun 5, 2023
092d720
update 300 mint md
ericatallah Jun 6, 2023
e9f1065
fix inscription creation scripts
ericatallah Jun 9, 2023
366ab8e
update 300 mint md
ericatallah Jun 9, 2023
7123004
update ord9 machine
ericatallah Jun 9, 2023
0f490e3
update csp, updatd 300 mint
ericatallah Jun 10, 2023
0f8026c
update inscribe-chain md
ericatallah Jun 10, 2023
dc5dfaa
log keypair and update inscribe
felipelincoln Jun 12, 2023
03bb5d2
fix fee bug
felipelincoln Jun 12, 2023
ec3032b
Merge pull request #29 from metagood/keypair-logging
ericatallah Jun 12, 2023
84d5f32
fix deriv path
felipelincoln Jun 14, 2023
207971e
remove extra line
felipelincoln Jun 14, 2023
45760f5
Merge pull request #32 from metagood/fix-deriv-path
felipelincoln Jun 14, 2023
48deac9
comment out validation
felipelincoln Jun 17, 2023
b4770ea
create file cli
felipelincoln Jun 17, 2023
1765a03
Merge pull request #35 from metagood/remove-inscription-validation
huuep Jun 18, 2023
3062578
Merge pull request #36 from metagood/file-cli
huuep Jun 18, 2023
e21178a
create 'ord wallet inscribe-chain-destination-addresses' cmd
ericatallah Jun 22, 2023
2725798
cleanup
ericatallah Jun 22, 2023
fcb0748
remove address validation, check if subdirs exist, add cmd descriptions
ericatallah Jun 23, 2023
070a9ed
change scripts back to 30
ericatallah Jun 23, 2023
37af6d6
add example addresses.txt
ericatallah Jun 23, 2023
5d1c911
Update src/subcommand/wallet/inscribe_chain_destination_addresses.rs
ericatallah Jun 28, 2023
b2e623a
Merge pull request #37 from metagood/inscribe-chain-destination-addre…
ericatallah Jun 28, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/target
/test-times.txt
/tmp
/300-inscriptions
12 changes: 12 additions & 0 deletions addresses.example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tb1p7t5xhyxj2g98eua7xfgrp5ufgwjypqje8q2z2cns79yaly4vv9lq5k4fmh
tb1p2khdgxygwmt4hs2ls9p39w6m9pf3lxfvtmg855h65jqazj0e2hrse387vm
tb1p833fd7mv8kngqf6acue3f8c9k63xwxu23ph3jmt8fjqn2p0d4amqawndj6
tb1pajkhapfr7qzsv84x4esmp8tt87rgfy2764a2we9zahawp02sn2ask4wwvp
tb1pak3d2nf3n2ezpm3tx52sswz2zzlr75ch9fq2qp8dt8re4a3r2p5shja0ku
tb1pw5fkhj4u9fhs4hednnd2x2tped4ssuwnxax39ndcakce7ayc6erq9679tm
tb1pkeetmfw2khdvlessj7wgk5gvmc4lg46cq4z5m590pkk8r80edrcqjxa82t
tb1pldqf2fmtj6f38z5qmtemlfx3rxmvt7sg3xq00px4yc90fe9adx4qfn6xpf
tb1pyc3ng7l4ry9e9tvhudeq8tlt3zu77uynjm4vx2wppvywvke2pd2scrtgrf
tb1pcxtr98jtam7zpk6lfvth675c43r8eteslgw9809ykucvdusquv3qzygc3s
tb1p44qzt7sxmjhr2rlhxw7y6zl5n4hhwlq35wuthfrkpx2rtqj4uxcqk02x2q
tb1pqswqkj4rp86lats7plu0ypc2u9vphnmackm0cccax8f8dchkq8jsc3u99u
Binary file added chain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions create-30-testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

dir="30-inscriptions-testnet"
mkdir -p $dir

parentInscriptionId="3995befab6b08427416bf9442d6877f6057780f31cdca37eb600a12bcf5e9345i0"
offsetInscriptionId="f4429c67523c9437f3db69fe0521f10dec4ae2b3bb64e98a1fd97c53c59803cai0"

for ((i=1; i<=30; i++)); do
filename="${i}.html"
filepath="${dir}/${filename}"
tokenID=$i

echo '<body/><script>j='$tokenID';d=document;b=d.body
class URLSearchParams{get=k=>k=="tokenID"?j:0}(async()=>{q="\n"
j=9520+(+await(await fetch("/content/'$offsetInscriptionId'")).text()+j)%300
if(isNaN(j))return;
h=(await(await fetch("/content/'$parentInscriptionId'")).text()).split(q)
b.innerHTML=h[2];
z=document.createElement("script")
z.innerHTML=h.slice(4,18).join(q)
b.appendChild(z)})()</script>' > "$filepath"

done

echo "Test files created!"
49 changes: 49 additions & 0 deletions create-30-with-addresses-testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

file="$1" # Path to the addresses file

# Check if the file exists
if [ ! -f "$file" ]; then
echo "Addresses file not found: $file"
exit 1
fi

dir="30-inscriptions-testnet"
mkdir -p $dir

inscriptions_dir="$dir/inscriptions"
mkdir -p $inscriptions_dir

addresses_dir="$dir/addresses"
mkdir -p $addresses_dir

# Read the file line by line
while IFS= read -r line; do
((count++))

filename="${count}.address"
filepath="${addresses_dir}/${filename}"
echo "$line" > "$filepath"
done < "$file"

parentInscriptionId="3995befab6b08427416bf9442d6877f6057780f31cdca37eb600a12bcf5e9345i0"
offsetInscriptionId="f4429c67523c9437f3db69fe0521f10dec4ae2b3bb64e98a1fd97c53c59803cai0"

for ((i=1; i<=30; i++)); do
filename="${i}.html"
filepath="${inscriptions_dir}/${filename}"
tokenID=$i

echo '<body/><script>j='$tokenID';d=document;b=d.body
class URLSearchParams{get=k=>k=="tokenID"?j:0}(async()=>{q="\n"
j=9520+(+await(await fetch("/content/'$offsetInscriptionId'")).text()+j)%300
if(isNaN(j))return;
h=(await(await fetch("/content/'$parentInscriptionId'")).text()).split(q)
b.innerHTML=h[2];
z=document.createElement("script")
z.innerHTML=h.slice(4,18).join(q)
b.appendChild(z)})()</script>' > "$filepath"

done

echo "Test files created!"
25 changes: 25 additions & 0 deletions create-300.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

mkdir -p 300-inscriptions

parentInscriptionId="2dbdf9ebbec6be793fd16ae9b797c7cf968ab2427166aaf390b90b71778266abi0"
offsetInscriptionId="<offset inscription id>"

for ((i=1; i<=300; i++)); do
filename="${i}.html"
filepath="300-inscriptions/${filename}"
tokenID=$i

echo '<body/><script>j='$tokenID';d=document;b=d.body
class URLSearchParams{get=k=>k=="tokenID"?j:0}(async()=>{q="\n"
j=9520+(+await(await fetch("/content/'$offsetInscriptionId'")).text()+j)%300
h=(await(await fetch("/content/'$parentInscriptionId'")).text()).split(q)
b.innerHTML=h.slice(0,27).join(q)
z=d.createElement("script")
z.innerHTML=`${h[28]};${h.slice(32,36).join(q)}`
b.appendChild(z)
init()})()</script>' > "$filepath"

done

echo "Files created!"
68 changes: 68 additions & 0 deletions inscribe-chain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# ord wallet inscribe-chain
> Broadcast a transaction chain to the mempool inscribing 10 ordinals, each containing one special sat extracted from a designated output.

![](chain.png)

## Requirements
1. utxo containing special sats must be padded with at least 1,000 normal sats at the beginning
2. if the utxo has more than one range of special sats, start with the last sat of the last range, because everything below that will be trimmed.
3. for each iteration, 10 inscriptions being created in one block, wallet must have 10 additional available utxos with enough sats for each inscription because 1 sat will come from the special utxo and the other 9,999 will come from any other normal utxo available in the wallet. **Important**: each of these prepared utxo's also needs to be large enough to pay the chosen fee rate for the inscription.
4. files to be inscribed must be named as `<number>.<extension>`, the inscribing will take place in that order.

## Example
1. Create the files to be inscribed:
```bash
mkdir files/
echo "1" > files/1.txt
echo "2" > files/2.txt
echo "3" > files/3.txt
echo "4" > files/4.txt
echo "5" > files/5.txt
echo "6" > files/6.txt
echo "7" > files/7.txt
echo "8" > files/8.txt
echo "9" > files/9.txt
echo "10" > files/10.txt
echo "11" > files/11.txt
echo "12" > files/12.txt
echo "13" > files/13.txt
echo "14" > files/14.txt
echo "15" > files/15.txt
```
2. Get the special utxo
```bash
ord wallet outputs
```
```json
[
{
"output": "7f320d87dd2d011ba9a3dbc66c46aed4b0b3a9a0a4d1c93fe3ed97ab280463f5:8",
"amount": 15000
}
]
```
Lets pick sats from `10_001` to `10_015` as the special ones, so my `satpoint` is:
```
7f320d87dd2d011ba9a3dbc66c46aed4b0b3a9a0a4d1c93fe3ed97ab280463f5:8:10014
```
3. Run the `inscribe-chain` command
> **Note**
> You must have at least 10 additional available utxos, each containing a minimum of 12,000 sats, when running this command. If you don't have enough, use the `ord wallet split` command to break one of your larger utxos into several smaller ones..

```bash
ord wallet inscribe-chain --fee-rate=1.0 --satpoint=7f320d87dd2d011ba9a3dbc66c46aed4b0b3a9a0a4d1c93fe3ed97ab280463f5:8:10014 files/
```
The sats `10015`, `10014`, `10013`, `10012`, `10011`, `10010`, `10009`, `10008`, `10007` and `10006` were extracted from the special utxo and given to the inscribed files `1.json`, `2.json`, ... `10.json` in this order.

4. Now we have to **wait for the block to be mined** and then run the next command (that was given when the previous completed):
> **Warning**
> If you run the following command while the previous transaction chain is still pending in the mempool, you will be able to inscribe only 2 more inscriptions and will have a commit transaction without the reveal. In other words, it will waste valuable special sats and will require a manual task to fix the transaction chain.
```bash
ord wallet inscribe-chain --fee-rate 1 --satpoint d3ecd1d753e09d2ca3a69fe1a36a7b829e3c096d44f101d11c5a3f6aef1e757b:0:10004 files/
```

And this is the full chain:
https://mempool.space/pt/signet/tx/58a7f430fbd5933d7f2dbcb9b2e1b4aaeea3af47a965c1a8917fa05bbf854a45#flow=&vin=0

![](mempool.png)
If we navigate through the first outputs we can see all the 10015 to 10001 sats being added to the commit outputs and then to the reveal output.
Binary file added mempool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,21 @@ impl Index {
)
}

pub(crate) fn insert_inscription_satpoint(
&self,
inscription_id: InscriptionId,
satpoint: SatPoint,
) -> Result {
let tx = self.database.begin_write()?;

tx.open_table(INSCRIPTION_ID_TO_SATPOINT)?
.insert(&inscription_id.store(), &satpoint.store())?;

tx.commit()?;

Ok(())
}

pub(crate) fn get_inscription_satpoint_by_id(
&self,
inscription_id: InscriptionId,
Expand Down
16 changes: 14 additions & 2 deletions src/index/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,21 @@ impl<'a> Updater<'a> {
&mut outpoint_sender,
&mut value_receiver,
&mut wtx,
block,
&block,
&mut value_cache,
)?;

if self.height.checked_sub(1).is_some() {
log::info!(
target: "new_inscription_satpoint",
"{{\"height\":{},\"block_hash\":\"{}\",\"prev_block_hash\":\"{}\",\"tx_count\":{}}}",
&self.height - 1,
&block.header.block_hash(),
&block.header.prev_blockhash,
&block.txdata.len(),
);
}

if let Some(progress_bar) = &mut progress_bar {
progress_bar.inc(1);

Expand Down Expand Up @@ -336,7 +347,7 @@ impl<'a> Updater<'a> {
outpoint_sender: &mut Sender<OutPoint>,
value_receiver: &mut Receiver<u64>,
wtx: &mut WriteTransaction,
block: BlockData,
block: &BlockData,
value_cache: &mut HashMap<OutPoint, u64>,
) -> Result<()> {
// If value_receiver still has values something went wrong with the last block
Expand Down Expand Up @@ -434,6 +445,7 @@ impl<'a> Updater<'a> {
block.header.time,
value_cache,
self.cached_children_by_id,
// &index.client,
)?;

if self.index_sats {
Expand Down
Loading