# v012 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 `sonic-callreq` 0.12.0 `src/uri.rs` (Apache-2.0, AluVM / RGB-WG).
- `DemoToken.rgb`: a contract consignment from the pinned `rgb-wallet` 0.12.0-rc.3, made offline from the RGB-WG/rgb v0.12.0-rc.3 `examples/` folder: `rgb -d data init`, `rgb -d data import RGB20-FNA.issuer`, `rgb -d data issue -w alice DemoToken.yaml`, `rgb -d data backup -f DemoToken DemoToken.rgb`. The pinned binary's `rgb -d data2 accept -w bob -u DemoToken.rgb` accepts it. The contract ID is `contract:nztjpjRX-_NVDDgd-EHENsqL-AKsGsyV-F6LzljB-X4WTv0Y`, the same one the RGB Docs quick-start shows.

The trusted issuer `rust/v012/issuers/RGB20-FNA.issuer` is copied from RGB-WG/rgb v0.12.0-rc.3 `examples/` (Apache-2.0).

- `TransferDemo.transfer.rgb`: a transfer consignment made by [`rust/gen-v012`](https://github.com/rgbjs/rgbjs/tree/gh-pages/rust/gen-v012) (see its `src/main.rs`) with `rgb-runtime` 0.12.0-rc.3, without any indexer or network. It starts from a fresh copy of the examples `data/`, plus `rgb -d data import RGB20-FNA.issuer` and Bob's auth token from `rgb -d data2 invoice -w bob --nonce 0 --seal-only DemoToken`. The generator gives Alice's demo wallet a made-up funding transaction (`b6bd8fa3…479b:0`, never broadcast), issues DemoToken on it as `TransferDemo` (`contract:KA73QdAH-BFBUNYX-0jsaAXq-_wKsXwD-2VLkZ9Q-1yRYYkc`), and pays Bob 10 with `pay_invoice`. The witness `fb0edb5f…49fc` is unsigned, which client-side validation doesn't need. The pinned `rgb-wallet` 0.12.0-rc.3 accepts it: `rgb -d <copy of data2> accept -w bob -u TransferDemo.transfer.rgb` exits 0, and the same file with byte 5000 flipped is rejected.
- `UfDemo.transfer.rgb`: an RGB25 (Uniquely Fungible Asset) transfer made by `rust/gen-v012 … RGB25-Demo.yaml … UfDemo 10` after `rgb import RGB25-UniquelyFungible-v0-aiRB3w.issuer`. The pinned `rgb-wallet` accepts it (`accept -w bob -u`, exit 0).
- `NftDemo.contract.rgb`: an RGB21 (Non-Fungible Unique Asset) contract, issued from `RGB21-Demo.yaml` after importing `RGB21-UniqueNFT-v0-FtU80Q.issuer`; the pinned `rgb-wallet` accepts it. There's no RGB21 transfer: `rgb-runtime` 0.12.0-rc.3 can't build one. An invoice URI's value is a number or a string, not the `{tokenNo, fractions}` an NFT needs, and the payment-script route fails with `StateCalc(UncountableState)`, because the bundler needs a countable state calculator to work out change.
- `RGB25-Demo.yaml`, `RGB21-Demo.yaml`: the issue parameters, from the pandora-prime/rgb-issuers templates adapted to rc.3. The issuer field is `checksum:` rather than `api:`, the NFT allocation fields are `tokenNo`/`fractions` (what the compiled issuer declares, not the template's `tokenIndex`/`fraction`), and the optional token fields are explicit `~`.

The RGB21 and RGB25 issuers in `rust/v012/issuers/` are from pandora-prime/rgb-issuers at commit 49b4048 (Apache-2.0), the same developer (`dns:pandoraprime.ch`) as the RGB20 FNA issuer.
- `created-{fna,ufa,nft}.contract.rgb`: contracts made by rgbjs's own `v012.issueContract` (RGB20 FNA, RGB25 UFA and RGB21 NFT) from the fixed parameters and noise seed in `test/created-params.js`. The pinned `rgb-wallet` accepts all three (`accept -u`, exit 0).
- `paid-fna.transfer.rgb`: a payment made by rgbjs's own `v012.payInvoice` (see `test/pay-params.js`): Alice pays Bob 1000 of 5000. Payments take random commitment entropy, so this is one sample run, not a reproduction. The pinned `rgb-wallet` accepts it (`accept -u`, exit 0).
- `receive-fna.transfer.rgb` and `receive-fna.secret.json`: the full receive loop. rgbjs's `createInvoice` derived Bob's auth token from a made-up outpoint and noise seed, [`rust/gen-v012`](https://github.com/rgbjs/rgbjs/tree/gh-pages/rust/gen-v012) paid it with `pay_invoice` (`BOB_AUTH=…`, contract `RecvDemo`), and `receive` must find the 10 units with Bob's secret.
