# v011 vector sources

- `upstream-invoices.json`: extracted by [`scripts/extract-vectors.py`](https://github.com/rgbjs/rgbjs/blob/gh-pages/scripts/extract-vectors.py) from the tests in `rgb-invoicing` 0.11.1 `src/parse.rs` (Apache-2.0, rgb-protocol).
- `demo.contract.rgb`: a NIA contract consignment from the pinned `rgb-cmd` 0.11.1, made offline: `rgb -n regtest import NonInflatableAsset.rgb`, `rgb -n regtest issue ssi:rgbjs-test demo.yaml`, `rgb export <id> demo.contract.rgb`. The CLI reported the contract ID `rgb:v4Kpkuwn-yjzKgYa-5G5h0cc-lLVyr2B-hdpCTaR-KOe~agc`. Its genesis seal is the mainnet genesis coinbase output: a test vector, not a real asset.
- `transfer-demo.transfer.rgb`: a transfer consignment made by [`rust/gen-v011`](https://github.com/rgbjs/rgbjs/tree/gh-pages/rust/gen-v011) (see its `src/main.rs`) with `rgb-api` 0.11.1, without any indexer or network. A wpkh wallet from a fixed test seed gets a made-up funding transaction (`07623012…c1c6:0`, never broadcast) through an in-process indexer. A NIA contract `rgb:epeKJw9q-4ciD_0S-NChLqoR-5INEwmm-lDL1OEH-ujhEX6Y` is issued on it, and the wallet pays the blinded invoice `rgb:epeKJw9q-…/~/BF/bcrt:utxob:dTwHqt40-IEPM8Yu-nFIXTvY-va2Nh7Y-xXpTu2P-F5DqjgD-0Hh4B?assignment_name=assetOwner` (100 units) with `RgbWallet::pay`, as `rgb transfer` does. The witness `2c54de90…efa5` is unsigned. The pinned `rgb-cmd` 0.11.1 can't validate it offline: its `validate` and `accept` resolve witnesses through an indexer.
- `cfa.transfer.rgb`, `uda.transfer.rgb`, `ifa.transfer.rgb`: one transfer per further rgb-schemas 0.11.1 schema, made by `rust/gen-v011 <out> cfa uda ifa` in the same way: CFA pays 100 of 100000; UDA pays the whole token (`1@2`, fraction 1 of index 2); IFA pays 100 of 100000 and leaves its 50000 inflation allowance on a second funding output untouched. Each funding transaction is made up and never broadcast; the witnesses are unsigned.
- `pfa.transfer.rgb`: a PFA (Permissioned Fungible Asset) transfer made by `rust/gen-v011 <out> pfa`. PFA transitions must carry an ECDSA signature over the transition ID by the key in the contract's `pubkey` global; the PFA script checks it with `vts`. `rgb-api` 0.11.1's `pay` doesn't sign, so the generator signs each transition after `pay`. The signature isn't part of the operation ID (`Transition::commit`), so nothing else changes. The test key is the SHA-256 of a fixed label and is public.
- `pfa-unsigned.invalid.rgb`: the same transfer before signing. It must be rejected: the PFA script fails with code 21.
- `created-{nia,cfa,uda,ifa,pfa}.contract.rgb`: contracts made by rgbjs's own `v011.issueContract` from the fixed parameters in `test/created-params.js` (`node scripts/make-created-vectors.mjs`). The tests check that the creator reproduces them byte for byte.
- `receive-nia.transfer.rgb` and `receive-nia.secret.json`: the full receive loop. rgbjs's `createInvoice` made Bob's invoice (blinding `424242` on a made-up outpoint), [`rust/gen-v011`](https://github.com/rgbjs/rgbjs/tree/gh-pages/rust/gen-v011) paid that exact invoice with `RgbWallet::pay` (`BOB_INVOICE=…`), and `receive` must find the 100 units with Bob's secret.
