Documentation
¶
Overview ¶
Package mersennet is the official Go client for Mersennet, the private, verifiable network (https://mersennet.com).
It covers the JSON-RPC API (eth_* plus the mersennet_* namespace), the on-chain order book exposed by the MersennetOrders precompile (markets, protocol switches, positions, collateral, agent keys, liquidatable accounts), and the shielded layer (viewing keys, note scanning, client-side balance and position reconstruction, portfolio attestations).
Quick start:
p := mersennet.NewProvider("https://rpc.mersennet.com")
orders := mersennet.NewOrders(p)
markets, err := orders.GetMarkets()
Documentation: https://docs.mersennet.com/developers/sdks/go/
Index ¶
- Constants
- Variables
- func ComputePortfolioDigest(grantID, grantorCommitment string, blockNumber uint64, ...) string
- func DefaultNullifierDeriver(note ShieldedNote) string
- func DelegateViewToken(vk ViewingKey, scope []string, expiry int64) (string, error)
- func NewMockNoteDecryptor(viewSecretHex string) func(GrantedNoteDecryptInput) ([]byte, error)
- func ToChainPrice(human float64, priceScale uint64) uint64
- func ToHumanPrice(chain uint64, priceScale uint64) float64
- func VerifyAttestation(a *ComplianceAttestation, verify Verifier) (bool, string)
- type BalanceReconstructionResult
- type Block
- type BuildAttestationOptions
- type ComplianceAttestation
- type EncryptedNoteEnvelope
- type FillRecord
- type GrantedDecryptedNote
- type GrantedNoteDecryptInput
- type GrantedNoteScanOptions
- type GrantedNoteScanResult
- type GrantedViewingMaterial
- type LogEntry
- type Market
- type MersennetError
- type NullifierDeriver
- type OpenOrder
- type Order
- type OrderBook
- type OrderBookLevel
- type OrderRecord
- type Orders
- func (o *Orders) AddMarket(base, quote, lot, tick string) (uint64, error)
- func (o *Orders) CancelOrder(orderID uint64) (bool, error)
- func (o *Orders) CollateralUnitsPerMRSN() (*big.Int, error)
- func (o *Orders) GetAgents(owner string) (map[string]interface{}, error)
- func (o *Orders) GetLiquidatable() ([]string, error)
- func (o *Orders) GetMarkets() ([]Market, error)
- func (o *Orders) GetOrderBook(market uint64) (*OrderBook, error)
- func (o *Orders) GetProtocol() (map[string]interface{}, error)
- func (o *Orders) PlaceOrder(market uint64, side, price, amount, tif, owner string) (map[string]interface{}, error)
- func (o *Orders) ToCollateralUnits(mrsn string) (*big.Int, error)
- type PortfolioNote
- type Provider
- func (p *Provider) BlockNumber() (uint64, error)
- func (p *Provider) Call(txObject map[string]interface{}) (string, error)
- func (p *Provider) ChainID() (uint64, error)
- func (p *Provider) GasPrice() (string, error)
- func (p *Provider) GetBalance(address string) (string, error)
- func (p *Provider) GetBlock(number interface{}, includeTxs bool) (*Block, error)
- func (p *Provider) GetBlockByHash(hash string, includeTxs bool) (*Block, error)
- func (p *Provider) GetCodeAttestation(address string) (map[string]interface{}, error)
- func (p *Provider) GetNonce(address string) (uint64, error)
- func (p *Provider) GetTransaction(hash string) (*Transaction, error)
- func (p *Provider) SendRawTransaction(rawTx string) (string, error)
- func (p *Provider) ViewBalances(grantID string, limit *int, cursorHex *string) (*ViewBalancesResult, error)
- func (p *Provider) ViewGrantStatus(grantID string) (*ViewGrantStatus, error)
- func (p *Provider) ViewNotes(grantID string, limit *int, cursorHex *string) (*ViewNotesResult, error)
- func (p *Provider) ViewOrders(grantID string) (*ViewTradingResult, error)
- func (p *Provider) ViewPositions(grantID string) (*ViewTradingResult, error)
- type Receipt
- type ReconstructOptions
- type ReconstructedPortfolio
- type ReconstructedPosition
- type ShieldedNote
- type Signer
- type Trade
- type Transaction
- type Verifier
- type ViewBalancesResult
- type ViewGrantStatus
- type ViewMarketAggregate
- type ViewNotesEntry
- type ViewNotesResult
- type ViewTradingResult
- type ViewingKey
Constants ¶
const AttestationVersion = "mersennet-attestation-v1"
AttestationVersion is the canonical attestation version string.
Variables ¶
var ErrSignedOrderRequired = errors.New(
"orders must be signed txs to the CLOB precompile (0x…0100) and submitted via SendRawTransaction; the unsigned RPC was removed")
ErrSignedOrderRequired is returned by the mutating order methods. Orders are now signed transactions to the CLOB precompile (0x0000000000000000000000000000000000000100); the unsigned owner-field RPC was removed for security (it let anyone trade as anyone). Build the placeOrder/cancelOrder/depositCollateral call, sign it, and submit via Provider.SendRawTransaction. Native Go signing helpers are a tracked follow-up; the TypeScript SDK is the reference implementation.
Functions ¶
func ComputePortfolioDigest ¶
func ComputePortfolioDigest(grantID, grantorCommitment string, blockNumber uint64, shieldedStateRoot string, perAsset map[uint32]*big.Int, unspent, spentNullifiers int) string
ComputePortfolioDigest returns the deterministic 0x-hex SHA-256 digest over the disclosed facts. Identical across the TS/Python/Go SDKs.
func DefaultNullifierDeriver ¶
func DefaultNullifierDeriver(note ShieldedNote) string
DefaultNullifierDeriver mirrors the chain's mock scheme: sha256(ownerPk || rho || psi). Production wallets override this with their real nullifier-viewing-key derivation (chain scheme: Poseidon(spend_sk, rho)).
func DelegateViewToken ¶
func DelegateViewToken(vk ViewingKey, scope []string, expiry int64) (string, error)
DelegateViewToken encodes a one-shot viewing token an auditor/counterparty can submit for selective disclosure. Base64-encoded JSON, parity with TS.
func NewMockNoteDecryptor ¶
func NewMockNoteDecryptor(viewSecretHex string) func(GrantedNoteDecryptInput) ([]byte, error)
NewMockNoteDecryptor returns the example/mock decryptor used by the SDK examples. This is not production viewing-key cryptography.
func ToChainPrice ¶
ToChainPrice converts a human price to on-chain units for a market.
func ToHumanPrice ¶
ToHumanPrice converts an on-chain price to a human price for a market.
func VerifyAttestation ¶
func VerifyAttestation(a *ComplianceAttestation, verify Verifier) (bool, string)
VerifyAttestation checks integrity (recompute digest from the attestation's own disclosed fields) and, if a Verifier is supplied and a signature is present, the signature. Returns (ok, reason).
Types ¶
type BalanceReconstructionResult ¶
type BalanceReconstructionResult struct {
ReconstructedPortfolio
GrantID string
BlockNumber uint64
ShieldedStateRoot string
TotalEncryptedNoteCount int
FetchedEncryptedNoteCnt int
SkippedMalformedCount int
SpentNullifierCount int
}
BalanceReconstructionResult is the end-to-end grant-gated balance read result.
func ScanAndReconstructBalances ¶
func ScanAndReconstructBalances(provider *Provider, material GrantedViewingMaterial, opts *GrantedNoteScanOptions, deriveNullifier NullifierDeriver) (*BalanceReconstructionResult, error)
ScanAndReconstructBalances pages mersennet_viewBalances, decrypts owned notes, collects the spent-nullifier set, and reconstructs spendable per-asset balances locally (Workstream F2 + F5).
type Block ¶
type Block struct {
Number string `json:"number"`
Hash string `json:"hash"`
GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
BaseFee string `json:"baseFeePerGas"`
StateRoot string `json:"stateRoot"`
Transactions []interface{} `json:"transactions"`
DomainEvents []interface{} `json:"domainEvents,omitempty"`
}
Block represents block data from eth_getBlockByNumber / eth_getBlockByHash. JSON tags match the camelCase field names emitted by the node's BlockDto.
type BuildAttestationOptions ¶
type BuildAttestationOptions struct {
GrantorCommitment string
Scope string
OnchainPortfolioDigst string
Attester string
Sign Signer
IssuedAt int64 // 0 => now
}
BuildAttestationOptions configures BuildPortfolioAttestation.
type ComplianceAttestation ¶
type ComplianceAttestation struct {
Version string `json:"version"`
GrantID string `json:"grantId"`
GrantorCommitment string `json:"grantorCommitment"`
BlockNumber uint64 `json:"blockNumber"`
ShieldedStateRoot string `json:"shieldedStateRoot"`
PerAsset map[string]string `json:"perAsset"` // assetId -> balance, decimal strings
UnspentNoteCount int `json:"unspentNoteCount"`
SpentNullifierCount int `json:"spentNullifierCount"`
PortfolioDigest string `json:"portfolioDigest"`
IssuedAt int64 `json:"issuedAt"`
Scope string `json:"scope"`
OnchainPortfolioDigst *string `json:"onchainPortfolioDigest"`
DigestMatchesOnchain *bool `json:"digestMatchesOnchain"`
Attester string `json:"attester,omitempty"`
Signature string `json:"signature,omitempty"`
}
ComplianceAttestation is the portable disclosure artifact.
func BuildPortfolioAttestation ¶
func BuildPortfolioAttestation(result *BalanceReconstructionResult, opts BuildAttestationOptions) (*ComplianceAttestation, error)
BuildPortfolioAttestation builds a compliance attestation from a reconstructed balance result.
type EncryptedNoteEnvelope ¶
EncryptedNoteEnvelope is the canonical encrypted note wrapper emitted by Mersennet.
func ParseEncryptedNotePayload ¶
func ParseEncryptedNotePayload(payloadHex string) (*EncryptedNoteEnvelope, error)
ParseEncryptedNotePayload decodes the bincode-encoded EncryptedNote envelope returned by mersennet_viewNotes.
type FillRecord ¶
FillRecord is a fill the wallet attributed to one of its orders.
type GrantedDecryptedNote ¶
type GrantedDecryptedNote struct {
NoteCommitment string
Envelope EncryptedNoteEnvelope
Note ShieldedNote
}
GrantedDecryptedNote is one successfully decrypted note record.
type GrantedNoteDecryptInput ¶
type GrantedNoteDecryptInput struct {
NoteCommitment string
EncryptedNoteHex string
Envelope EncryptedNoteEnvelope
}
GrantedNoteDecryptInput is the input passed to a caller-supplied note decryptor.
type GrantedNoteScanOptions ¶
GrantedNoteScanOptions controls pagination for note scanning.
type GrantedNoteScanResult ¶
type GrantedNoteScanResult struct {
GrantID string
BlockNumber uint64
TotalEncryptedNoteCount int
FetchedEncryptedNoteCount int
NextCursor string
SkippedMalformedCount int
Notes []GrantedDecryptedNote
}
GrantedNoteScanResult is the aggregated result of scanning mersennet_viewNotes pages.
func ScanGrantedNotes ¶
func ScanGrantedNotes(provider *Provider, material GrantedViewingMaterial, opts *GrantedNoteScanOptions) (*GrantedNoteScanResult, error)
ScanGrantedNotes pages through mersennet_viewNotes and locally decrypts matching note envelopes.
type GrantedViewingMaterial ¶
type GrantedViewingMaterial struct {
GrantID string
RecipientPublicKey string
Decrypt func(GrantedNoteDecryptInput) ([]byte, error)
}
GrantedViewingMaterial carries the grant id plus the decryptor that uses the delegated viewing material.
func CreateOwnerViewingMaterial ¶
func CreateOwnerViewingMaterial(vk ViewingKey, grantIDHex string) GrantedViewingMaterial
CreateOwnerViewingMaterial builds the viewing material a wallet uses to scan its OWN notes. The decryptor is keyed by the wallet's secret viewing scalar; the scan is filtered to notes addressed to its public viewing key.
type LogEntry ¶
type LogEntry struct {
Address string `json:"address"`
Topics []string `json:"topics"`
Data string `json:"data"`
BlockNumber string `json:"blockNumber"`
BlockHash string `json:"blockHash"`
TransactionHash string `json:"transactionHash"`
TransactionIndex string `json:"transactionIndex"`
LogIndex string `json:"logIndex"`
Removed bool `json:"removed"`
}
LogEntry represents a log entry. JSON tags match the camelCase field names emitted by the node's LogDto.
type Market ¶
type Market struct {
ID uint64 `json:"id"`
Symbol string `json:"symbol"`
TickSize string `json:"tickSize"`
LotSize string `json:"lotSize"`
LastPrice string `json:"lastPrice"`
PriceScale uint64 `json:"priceScale"`
Status string `json:"status"`
}
Market is a listed market as reported by mersennet_orders_getMarkets. PriceScale: on-chain price = human price × PriceScale (1 = integer prices).
type MersennetError ¶
MersennetError represents an RPC or SDK error
func (*MersennetError) Error ¶
func (e *MersennetError) Error() string
type NullifierDeriver ¶
type NullifierDeriver func(ShieldedNote) string
NullifierDeriver maps an owned note to its on-chain nullifier (0x-prefixed hex).
type OpenOrder ¶
OpenOrder is a still-resting order with its unfilled remainder.
func ReconstructOpenOrders ¶
func ReconstructOpenOrders(orders []OrderRecord, fills []FillRecord) ([]OpenOrder, error)
ReconstructOpenOrders reports every non-cancelled order whose filled size is below its original size, with the unfilled remainder.
type Order ¶
type Order struct {
ID string `json:"id"`
Owner string `json:"owner"`
MarketID string `json:"market_id"`
Side string `json:"side"`
Price string `json:"price"`
Size string `json:"size"`
TIF string `json:"tif"`
}
Order represents an order in the order book
type OrderBook ¶
type OrderBook struct {
Bids []OrderBookLevel `json:"bids"`
Asks []OrderBookLevel `json:"asks"`
}
OrderBook represents the full order book
type OrderBookLevel ¶
OrderBookLevel represents a price level
type OrderRecord ¶
type OrderRecord struct {
OrderID string
MarketID int
Side string // "buy" | "sell"
Price *big.Int
Size *big.Int
Status string // "" | "open" | "cancelled"
}
OrderRecord is an order the wallet submitted, as recorded at submit time.
type Orders ¶
type Orders struct {
// contains filtered or unexported fields
}
Orders provides CLOB interaction for Mersennet
func (*Orders) CancelOrder ¶
CancelOrder is deprecated: cancels are signed txs to the CLOB precompile (the chain enforces order ownership). See ErrSignedOrderRequired.
func (*Orders) CollateralUnitsPerMRSN ¶
CollateralUnitsPerMRSN returns the collateral units that make up one MRSN in the current era: 10^18 before the settlement switch (a unit was one wei) and 1 from it (a unit is one MRSN), read from getProtocol().weiPerCollateralUnit.
func (*Orders) GetAgents ¶
GetAgents returns the agent keys granted by owner and whether delegation is active.
func (*Orders) GetLiquidatable ¶
GetLiquidatable returns the accounts below maintenance margin at the head (keeper feed; empty before the settlement switch).
func (*Orders) GetMarkets ¶
GetMarkets lists the markets with tick/lot sizes and price scales.
func (*Orders) GetOrderBook ¶
GetOrderBook returns the order book for a market
func (*Orders) GetProtocol ¶
GetProtocol returns every CLOB consensus switch and live parameter (mersennet_orders_getProtocol): margin bps, wei per collateral unit, insurance fund, bad debt, market price scales.
func (*Orders) PlaceOrder ¶
func (o *Orders) PlaceOrder(market uint64, side, price, amount, tif, owner string) (map[string]interface{}, error)
PlaceOrder is deprecated: orders are signed txs to the CLOB precompile. See ErrSignedOrderRequired. Build the placeOrder call, sign it, and submit via Provider.SendRawTransaction.
type PortfolioNote ¶
type PortfolioNote struct {
Note ShieldedNote
Nullifier string
Spent bool
}
PortfolioNote is a decrypted note tagged with its derived nullifier and spent flag.
type Provider ¶
type Provider struct {
URL string
// contains filtered or unexported fields
}
Provider is the JSON-RPC client for Mersennet
func (*Provider) BlockNumber ¶
BlockNumber returns the latest block number
func (*Provider) GetBalance ¶
GetBalance returns the balance of an address
func (*Provider) GetBlockByHash ¶
GetBlockByHash returns a block by hash
func (*Provider) GetCodeAttestation ¶
GetCodeAttestation returns the on-chain code-publication attestation for a contract, or nil if unpublished.
func (*Provider) GetTransaction ¶
func (p *Provider) GetTransaction(hash string) (*Transaction, error)
GetTransaction returns a transaction by hash
func (*Provider) SendRawTransaction ¶
SendRawTransaction sends a raw signed transaction
func (*Provider) ViewBalances ¶
func (p *Provider) ViewBalances(grantID string, limit *int, cursorHex *string) (*ViewBalancesResult, error)
ViewBalances returns a grant-gated (`balances:read`) page from mersennet_viewBalances: the encrypted-note page plus the spent-nullifier set. Pair with ReconstructPortfolio to derive spendable balances locally.
func (*Provider) ViewGrantStatus ¶
func (p *Provider) ViewGrantStatus(grantID string) (*ViewGrantStatus, error)
ViewGrantStatus returns the lifecycle/status of a viewing grant.
func (*Provider) ViewNotes ¶
func (p *Provider) ViewNotes(grantID string, limit *int, cursorHex *string) (*ViewNotesResult, error)
ViewNotes returns grant-gated encrypted notes from mersennet_viewNotes.
func (*Provider) ViewOrders ¶
func (p *Provider) ViewOrders(grantID string) (*ViewTradingResult, error)
ViewOrders returns the grant-gated (`orders:read`) public market context + grant binding from mersennet_viewOrders. Pair with ReconstructOpenOrders over the wallet's local order records.
func (*Provider) ViewPositions ¶
func (p *Provider) ViewPositions(grantID string) (*ViewTradingResult, error)
ViewPositions returns the grant-gated (`positions:read`) public market context + grant binding from mersennet_viewPositions. Pair with ReconstructPositions over the wallet's local fill records.
type Receipt ¶
type Receipt struct {
TransactionHash string `json:"transactionHash"`
BlockHash string `json:"blockHash"`
BlockNumber string `json:"blockNumber"`
TransactionIndex string `json:"transactionIndex"`
From string `json:"from"`
To *string `json:"to"`
GasUsed string `json:"gasUsed"`
CumulativeGasUsed string `json:"cumulativeGasUsed"`
EffectiveGasPrice string `json:"effectiveGasPrice"`
Status string `json:"status"`
ContractAddress *string `json:"contractAddress"`
LogsBloom string `json:"logsBloom"`
Type string `json:"type"`
Logs []LogEntry `json:"logs"`
}
Receipt represents a transaction receipt. JSON tags match the camelCase field names emitted by the node's ReceiptDto.
type ReconstructOptions ¶
type ReconstructOptions struct {
DeriveNullifier NullifierDeriver
SpentNullifiers []string
IsSpent func(string) bool
}
ReconstructOptions configures reconstruction.
type ReconstructedPortfolio ¶
type ReconstructedPortfolio struct {
PerAsset map[uint32]*big.Int
UnspentNoteCount int
SpentNoteCount int
TotalNoteCount int
Notes []PortfolioNote
}
ReconstructedPortfolio holds spendable balances per asset (unspent notes only).
func ReconstructPortfolio ¶
func ReconstructPortfolio(notes []ShieldedNote, opts *ReconstructOptions) ReconstructedPortfolio
ReconstructPortfolio reconstructs spendable balances from decrypted notes. Notes are de-duplicated by nullifier; only unspent notes contribute.
type ReconstructedPosition ¶
type ReconstructedPosition struct {
MarketID int
NetSize *big.Int // signed: positive long, negative short, 0 flat
EntryPrice *big.Int // size-weighted average entry of open exposure
RealizedPnl *big.Int
}
ReconstructedPosition is a per-market net position.
func ReconstructPositions ¶
func ReconstructPositions(fills []FillRecord) ([]ReconstructedPosition, error)
ReconstructPositions reconstructs per-market positions from fills using average-cost accounting. Pass fills chronologically.
type ShieldedNote ¶
ShieldedNote is the decoded note plaintext recovered client-side after decryption.
func ParseShieldedNotePlaintext ¶
func ParseShieldedNotePlaintext(plaintext []byte) (*ShieldedNote, error)
ParseShieldedNotePlaintext decodes a bincode-encoded Note plaintext.
type Trade ¶
type Trade struct {
Taker string `json:"taker"`
Maker string `json:"maker"`
MarketID string `json:"market_id"`
Side string `json:"side"`
Price string `json:"price"`
Size string `json:"size"`
}
Trade represents a trade execution
type Transaction ¶
type Transaction struct {
Hash string `json:"hash"`
From string `json:"from"`
To *string `json:"to"`
Value string `json:"value"`
Nonce string `json:"nonce"`
Gas string `json:"gas"`
GasPrice string `json:"gasPrice"`
Input string `json:"input"`
}
Transaction represents transaction data. JSON tags match the camelCase field names emitted by the node's TxDto.
type ViewBalancesResult ¶
type ViewBalancesResult struct {
GrantID string `json:"grantId"`
GrantorCommitment string `json:"grantorCommitment"`
BlockNumber uint64 `json:"blockNumber"`
ShieldedStateRoot string `json:"shieldedStateRoot"`
TotalEncryptedNoteCount int `json:"totalEncryptedNoteCount"`
ReturnedEncryptedNoteCount int `json:"returnedEncryptedNoteCount"`
NextCursor *string `json:"nextCursor"`
Notes []ViewNotesEntry `json:"notes"`
SpentNullifiers []string `json:"spentNullifiers"`
SpentNullifierCount int `json:"spentNullifierCount"`
Reconstruction string `json:"reconstruction"`
SignatureVerified bool `json:"signatureVerified"`
}
ViewBalancesResult is the mersennet_viewBalances response: an encrypted-note page plus the spent-nullifier set for client-side balance reconstruction.
type ViewGrantStatus ¶
type ViewGrantStatus struct {
Exists bool `json:"exists"`
Status string `json:"status"`
ActiveNow bool `json:"activeNow"`
SignatureVerified bool `json:"signatureVerified"`
Revoked bool `json:"revoked"`
RevokedAtBlock *uint64 `json:"revokedAtBlock"`
GrantToken map[string]interface{} `json:"grantToken"`
}
ViewGrantStatus is the mersennet_viewGrantStatus response.
type ViewMarketAggregate ¶
type ViewMarketAggregate struct {
MarketID int `json:"marketId"`
MarkPrice string `json:"markPrice"`
LongOpenInterest string `json:"longOpenInterest"`
ShortOpenInterest string `json:"shortOpenInterest"`
LastClearingPrice string `json:"lastClearingPrice"`
LastVolume string `json:"lastVolume"`
LiquidatableCount int `json:"liquidatableCount"`
}
ViewMarketAggregate is one public per-market aggregate in a trading view read.
type ViewNotesEntry ¶
type ViewNotesEntry struct {
NoteCommitment string `json:"noteCommitment"`
EncryptedNote string `json:"encryptedNote"`
}
ViewNotesEntry represents one encrypted note returned by mersennet_viewNotes.
type ViewNotesResult ¶
type ViewNotesResult struct {
GrantID string `json:"grantId"`
GrantorCommitment string `json:"grantorCommitment"`
BlockNumber uint64 `json:"blockNumber"`
ShieldedStateRoot string `json:"shieldedStateRoot"`
TotalEncryptedNoteCount int `json:"totalEncryptedNoteCount"`
ReturnedEncryptedNoteCount int `json:"returnedEncryptedNoteCount"`
NextCursor *string `json:"nextCursor"`
Notes []ViewNotesEntry `json:"notes"`
SignatureVerified bool `json:"signatureVerified"`
}
ViewNotesResult represents the mersennet_viewNotes response.
type ViewTradingResult ¶
type ViewTradingResult struct {
GrantID string `json:"grantId"`
GrantorCommitment string `json:"grantorCommitment"`
BlockNumber uint64 `json:"blockNumber"`
ShieldedStateRoot string `json:"shieldedStateRoot"`
MarketAggregates struct {
Markets []ViewMarketAggregate `json:"markets"`
} `json:"marketAggregates"`
Reconstruction string `json:"reconstruction"`
SignatureVerified bool `json:"signatureVerified"`
}
ViewTradingResult is the mersennet_viewPositions / mersennet_viewOrders response: public market context + grant binding only (rows reconstructed client-side).
type ViewingKey ¶
ViewingKey is a shielded viewing/spend keypair.
func ViewingKeyFromSeed ¶
func ViewingKeyFromSeed(seed string) ViewingKey
ViewingKeyFromSeed derives a viewing key from a seed (parity with ViewingKeyHelpers.fromSeed). Deterministic placeholder; do not use for real funds.