/build/rpc / contracts / repo
repo.share_offer
repo.share_offer "id" ( "context" "transport" ttl ) Export a repo offer and create a cosign session for secure sharing with counterparty. This is a convenience wrapper that combines repo.export_offer with cosign.init. Arguments: 1. id (string, required) Repo offer identifier 2. context (string, optional) Human-readable context label (default: "repo-offer") 3. transport (string, optional) Transport: auto|websocket|nostr (default: auto) 4. ttl (numeric, optional) Session TTL in seconds (default: 1800) Result: { (json object) "offer_id" : "hex", (string) Repo offer identifier "offer" : { (json object) Exported repo offer payload "version" : n, (numeric) Offer payload version "contract_type" : "str", (string) Contract type (repo) "id" : "hex", (string) Offer identifier "terms" : { (json object) Canonicalised repo terms "principal_leg" : { (json object) Principal asset leg "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "interest_leg" : { (json object) Interest asset leg "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "collateral_leg" : { (json object) Collateral asset leg "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "principal_is_native" : true|false, (boolean) True when the principal leg is denominated in BTC "principal_asset_id" : "hex", (string, optional) 32-byte asset identifier for non-native principal legs "asset_id" : "hex", (string, optional) Compatibility alias for principal asset id (null when native) "principal_units" : n, (numeric) Principal units (or sats when native) delivered at open "interest_units" : n, (numeric) Fixed interest units owed by the borrower "repay_units" : n, (numeric) Total units owed at repayment "collateral_sats" : n, (numeric, optional) BTC collateral amount (only when collateral is native) "collateral_sats_raw" : n, (numeric, optional) Collateral in satoshis (only when collateral is native) "maturity_height" : n, (numeric) Block height activating the default branch "safety_k" : n, (numeric) Pre-maturity safety window used for UX warnings "reorg_conf" : n (numeric) Confirmations required past maturity before default sweep }, "sinks" : { (json object) Canonical sink set "collateral_spk" : "hex", (string) Hex-encoded Taproot script for the collateral vault "repay_spk" : "hex" (string) Hex-encoded Taproot script for the repayment sink }, "fs_policy" : { (json object) Fair-Sign policy "require_adaptor" : true|false, (boolean) Require adaptor signatures (Fair-Sign) "reveal_lockstep" : true|false (boolean) Enforce lock-step final signature reveal }, "fs_tx_adaptor_point" : "hex", (string) Global adaptor point (x-only, hex) "salt" : "hex", (string) Salt used when computing the commitment "commitment" : "hex", (string) Commitment hash "created_height" : n, (numeric) Wallet chain height when the offer was recorded "created_time" : xxx, (numeric) Wall-clock creation timestamp "borrower_address" : "str", (string) Borrower covenant address (bech32m) "lender_address" : "str", (string) Initial repayment address (bech32m) "lender_internal_key" : "hex", (string, optional) Untweaked lender key used in default covenant leaf (x-only, hex) "borrower_internal_key" : "hex", (string, optional) Untweaked borrower key (x-only, hex) "maker_role" : "str", (string, optional) Which side created the offer (borrower or lender) "fee_policy_strategy" : "str", (string, optional) Fee policy strategy used for the contract "repay_address_override" : "str", (string, optional) Current repayment override "vault" : { (json object, optional) Tracked collateral vault outpoint once known "txid" : "hex", (string) Vault funding transaction id "vout" : n, (numeric) Vault output index "amount" : n (numeric) Vault amount in BTC }, "acceptance" : { (json object, optional) Counterparty acceptance payload "version" : n, (numeric) Acceptance payload version "contract_type" : "str", (string) Contract type (repo) "offer_id" : "hex", (string) Offer identifier "id" : "hex", (string) Acceptance identifier "sinks_ack" : { (json object) Acknowledged sink set "repay_spk" : "hex" (string) Hex-encoded Taproot repayment script acknowledged by the counterparty }, "fs_policy_ack" : { (json object) Acknowledged Fair-Sign policy "require_adaptor" : true|false, (boolean) Require adaptor signatures (Fair-Sign) "reveal_lockstep" : true|false (boolean) Enforce lock-step final signature reveal }, "fs_tx_adaptor_point" : "hex", (string) Counterparty adaptor point (x-only, hex) "salt" : "hex", (string) Acceptance salt "commitment" : "hex", (string) Acceptance commitment "borrower_internal_key" : "hex", (string, optional) Borrower's internal key for vault construction (x-only, hex) "lender_internal_key" : "hex", (string, optional) Untweaked lender key (x-only, hex) "repay_templates" : [ (json array, optional) Pre-built repayment delivery templates { (json object) "purpose" : "str", (string) Template purpose (repay_principal, repay_interest, or repay_merged) "is_native" : true|false, (boolean) Whether repayment is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native }, ... ], "default_collateral_template" : { (json object, optional) Pre-built collateral sweep template "purpose" : "str", (string) Template purpose (default_collateral) "is_native" : true|false, (boolean) Whether sweep is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native } }, "repay_tx" : { (json object, optional) Repayment transaction details once detected "txid" : "hex", (string) Repayment transaction id "height" : n, (numeric, optional) Block height when repayment was confirmed "time" : xxx (numeric, optional) Timestamp when repayment was confirmed }, "default_tx" : { (json object, optional) Default/liquidation transaction details once detected "txid" : "hex", (string) Default transaction id "height" : n, (numeric, optional) Block height when default was confirmed "time" : xxx (numeric, optional) Timestamp when default was confirmed } }, "cosign" : { (json object) Cosign session details "session_id" : "str", (string) Cosign session identifier "invite_link" : "str", (string) Invite link for counterparty "sas" : "str" (string) Short Authentication String } } Examples: > bitcoin-cli repo.share_offer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Signature
repo.share_offer(id: string, context?: string, transport?: string, ttl?: number) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"repo.share_offer","params":["\"<id>\"","\"<context>\"","\"<transport>\"",0]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| id | string | yes | Repo offer identifier |
| context | string | — | Human-readable context label (default: "repo-offer") |
| transport | string | — | Transport: auto|websocket|nostr (default: auto) |
| ttl | number | — | Session TTL in seconds (default: 1800) |
Result
Type: any
{ (json object) "offer_id" : "hex", (string) Repo offer identifier "offer" : { (json object) Exported repo offer payload "version" : n, (numeric) Offer payload version "contract_type" : "str", (string) Contract type (repo) "id" : "hex", (string) Offer identifier "terms" : { (json object) Canonicalised repo terms "principal_leg" : { (json object) Principal asset leg "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "interest_leg" : { (json object) Interest asset leg "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "collateral_leg" : { (json object) Collateral asset leg "is_native" : true|false, (boolean) True when the leg is denominated in BTC "asset_id" : "hex", (string, optional) 32-byte asset identifier when non-native "units" : n (numeric) Exact units (sats or asset units) delivered }, "principal_is_native" : true|false, (boolean) True when the principal leg is denominated in BTC "principal_asset_id" : "hex", (string, optional) 32-byte asset identifier for non-native principal legs "asset_id" : "hex", (string, optional) Compatibility alias for principal asset id (null when native) "principal_units" : n, (numeric) Principal units (or sats when native) delivered at open "interest_units" : n, (numeric) Fixed interest units owed by the borrower "repay_units" : n, (numeric) Total units owed at repayment "collateral_sats" : n, (numeric, optional) BTC collateral amount (only when collateral is native) "collateral_sats_raw" : n, (numeric, optional) Collateral in satoshis (only when collateral is native) "maturity_height" : n, (numeric) Block height activating the default branch "safety_k" : n, (numeric) Pre-maturity safety window used for UX warnings "reorg_conf" : n (numeric) Confirmations required past maturity before default sweep }, "sinks" : { (json object) Canonical sink set "collateral_spk" : "hex", (string) Hex-encoded Taproot script for the collateral vault "repay_spk" : "hex" (string) Hex-encoded Taproot script for the repayment sink }, "fs_policy" : { (json object) Fair-Sign policy "require_adaptor" : true|false, (boolean) Require adaptor signatures (Fair-Sign) "reveal_lockstep" : true|false (boolean) Enforce lock-step final signature reveal }, "fs_tx_adaptor_point" : "hex", (string) Global adaptor point (x-only, hex) "salt" : "hex", (string) Salt used when computing the commitment "commitment" : "hex", (string) Commitment hash "created_height" : n, (numeric) Wallet chain height when the offer was recorded "created_time" : xxx, (numeric) Wall-clock creation timestamp "borrower_address" : "str", (string) Borrower covenant address (bech32m) "lender_address" : "str", (string) Initial repayment address (bech32m) "lender_internal_key" : "hex", (string, optional) Untweaked lender key used in default covenant leaf (x-only, hex) "borrower_internal_key" : "hex", (string, optional) Untweaked borrower key (x-only, hex) "maker_role" : "str", (string, optional) Which side created the offer (borrower or lender) "fee_policy_strategy" : "str", (string, optional) Fee policy strategy used for the contract "repay_address_override" : "str", (string, optional) Current repayment override "vault" : { (json object, optional) Tracked collateral vault outpoint once known "txid" : "hex", (string) Vault funding transaction id "vout" : n, (numeric) Vault output index "amount" : n (numeric) Vault amount in BTC }, "acceptance" : { (json object, optional) Counterparty acceptance payload "version" : n, (numeric) Acceptance payload version "contract_type" : "str", (string) Contract type (repo) "offer_id" : "hex", (string) Offer identifier "id" : "hex", (string) Acceptance identifier "sinks_ack" : { (json object) Acknowledged sink set "repay_spk" : "hex" (string) Hex-encoded Taproot repayment script acknowledged by the counterparty }, "fs_policy_ack" : { (json object) Acknowledged Fair-Sign policy "require_adaptor" : true|false, (boolean) Require adaptor signatures (Fair-Sign) "reveal_lockstep" : true|false (boolean) Enforce lock-step final signature reveal }, "fs_tx_adaptor_point" : "hex", (string) Counterparty adaptor point (x-only, hex) "salt" : "hex", (string) Acceptance salt "commitment" : "hex", (string) Acceptance commitment "borrower_internal_key" : "hex", (string, optional) Borrower's internal key for vault construction (x-only, hex) "lender_internal_key" : "hex", (string, optional) Untweaked lender key (x-only, hex) "repay_templates" : [ (json array, optional) Pre-built repayment delivery templates { (json object) "purpose" : "str", (string) Template purpose (repay_principal, repay_interest, or repay_merged) "is_native" : true|false, (boolean) Whether repayment is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native }, ... ], "default_collateral_template" : { (json object, optional) Pre-built collateral sweep template "purpose" : "str", (string) Template purpose (default_collateral) "is_native" : true|false, (boolean) Whether sweep is native BTC "units" : n, (numeric) Raw units represented by the template "script_pubkey" : "hex", (string) Destination scriptPubKey "commitment" : "hex", (string) Commitment hash over script and TLV metadata "asset_id" : "hex", (string, optional) Asset identifier when non-native "vext" : "hex" (string, optional) Asset TLV bytes when non-native } }, "repay_tx" : { (json object, optional) Repayment transaction details once detected "txid" : "hex", (string) Repayment transaction id "height" : n, (numeric, optional) Block height when repayment was confirmed "time" : xxx (numeric, optional) Timestamp when repayment was confirmed }, "default_tx" : { (json object, optional) Default/liquidation transaction details once detected "txid" : "hex", (string) Default transaction id "height" : n, (numeric, optional) Block height when default was confirmed "time" : xxx (numeric, optional) Timestamp when default was confirmed } }, "cosign" : { (json object) Cosign session details "session_id" : "str", (string) Cosign session identifier "invite_link" : "str", (string) Invite link for counterparty "sas" : "str" (string) Short Authentication String } }
Source: services/core-node/bcore/src/wallet/rpc/contracts.cpp:2854
C++ symbol: repo_share_offer